On this page
sre_parse.SubPattern
Prev: sre_parse.State | Up: sre_parse | Next: sre_parse.Tokenizer
Rel: sre_parse.error, sre_parse.fix_flags, sre_parse.parse, sre_parse.parse_template
Ref: docs.python.org — sre_parse.SubPattern
Tags: #public #python3 #stdlib #sre_parse
Import
import sre_parse
from sre_parse import SubPattern
Signature & Overview
sre_parse.SubPattern(state, data=None)
sre_parse.SubPattern class.
Methods & Attributes
SubPattern.append(self, code)—SubPattern.appendmethod/property.SubPattern.dump(self, level=0)—SubPattern.dumpmethod/property.SubPattern.getwidth(self)—SubPattern.getwidthmethod/property.SubPattern.insert(self, index, code)—SubPattern.insertmethod/property.
Usage
import re
# Internal regex AST container; use re.compile(..., re.DEBUG) to inspect
assert re.compile(r'(ab)+').groups == 1
Gotchas
- Deprecated internal shim.
REPL Inspect
from sre_parse import SubPattern
help(SubPattern)
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/State Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_parse/Tokenizer Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_parse/error Linked here; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_parse/fix_flags Linked here; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_parse/parse Linked here; shared tags: #stdlib
- tuts/python3/stdlib_module/sre_parse/parse_template Linked here; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib