On this page
sre_compile.error
Prev: sre_compile.dis | Up: sre_compile | Next: sre_compile.isstring
Rel: sre_compile.compile, sre_compile.dis, sre_compile.isstring, sre_compile.PatternError
Ref: docs.python.org โ sre_compile.error
Tags: #public #python3 #stdlib #sre_compile
Import
import sre_compile
from sre_compile import error
Signature & Overview
sre_compile.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
# Use re.error instead of sre_compile.error
assert issubclass(re.error, Exception)
Gotchas
- Deprecated internal shim.
REPL Inspect
from sre_compile import error
help(error)
Linked from
Related notes
- tuts/python3/stdlib_module/sre_compile Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_compile/compile Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_compile/dis Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_compile/isstring Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_compile/PatternError 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
- tuts/c/stdlib/ctype shared tags: #stdlib