ID EN
Regular Expression

error

Python 3.11

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:

Syntax

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