On this page
sre_parse.PatternError
Prev: sre_parse.parse_template | Up: sre_parse | Next: sre_parse.State
Rel: sre_parse.error, sre_parse.fix_flags, sre_parse.parse, sre_parse.parse_template
Ref: docs.python.org โ sre_parse.PatternError
Tags: #public #python3 #stdlib #sre_parse
Import
import sre_parse
from sre_parse import PatternError
Signature & Overview
sre_parse.PatternError(msg, pattern=None, pos=None)
Exception raised for invalid regular expressions.
Methods & Attributes
PatternError.add_note(self, note, /)โ Add a note to the exceptionPatternError.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
import re
assert issubclass(re.error, Exception)
Gotchas
- Deprecated internal shim: Use
re.error/re.PatternError.
REPL Inspect
from sre_parse import PatternError
help(PatternError)
Linked from
Related notes
- tuts/python3/stdlib_module/sre_parse Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_parse/error Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_parse/fix_flags Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_parse/parse Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_parse/parse_template Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_parse/State Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib