PyDocs

Nav

Text Processing Services

PatternError

re

exception (source)
  • PatternError(msg, pattern=None, pos=None)
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)
Changed in 3.5, 3.13
  • 3.5: Added additional attributes.
  • 3.13: PatternError was originally named error; the latter is kept as an alias for backward compatibility.
Members of PatternError

c

colno
The column corresponding to pos (may be None).

l

lineno
The line corresponding to pos (may be None).

m

msg
The unformatted error message.

p

pattern
The regular expression pattern.
pos
The index in pattern where compilation failed (may be None).
0 Examples
No examples for re/PatternError.
See Also
No see-alsos for re/PatternError
0 Notes
No notes for PatternError