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