re.error

exception re.error(msg, pattern=None, pos=None)

Exception raised when a string passed to one of the functions here is not a valid regular expression (for example, it might contain unmatched parentheses) or when some other error occurs during compilation or matching. It is never an error if a string contains no match for a pattern. The error instance has the following additional attributes:

msg

The unformatted error message.

pattern

The regular expression pattern.

pos

The index of pattern where compilation failed.

lineno

The line corresponding to pos.

colno

The column corresponding to pos.

Changed in version 3.5: Added additional attributes.

doc_python
2016-10-07 17:41:13
Comments
Leave a Comment

Please login to continue.