class_docstr: Exception raised for invalid regular expressions.
  
  Attributes:
  
      msg: The unformatted error message
      pattern: The regular expression pattern
      pos: The index in the pattern where compilation failed (may be None)
      lineno: The line corresponding to pos (may be None)
      colno: The column corresponding to pos (may be None)
code: def __init__(self, msg, pattern=None, pos=None):
      self.msg = msg
      self.pattern = pattern
      self.pos = pos
      if pattern is not None and pos is not None:
          msg = "%s at position %d" % (msg, pos)
          if isinstance(pattern, str):
              newline = "\n"
          else:
              newline = b"\n"
          self.lineno = pattern.count(newline, 0, pos) + 1
          self.colno = pos - pattern.rfind(newline, 0, pos)
          if newline in pattern:
              msg = "%s (line %d, column %d)" % (
                  msg,
                  self.lineno,
                  self.colno,
              )
      else:
          self.lineno = self.colno = None
      super().__init__(msg)
  
file_path: catboost/contrib/tools/python3/src/Lib/re/_constants.py
imports: from _sre import MAXREPEAT, MAXGROUPS
label_desc: Use image node_id 1 to create a new error object from inherited base classes: Exception with example: obj = error(msg, pattern, pos)