META_RGXS: Patterns for Parsing Patterns#

my.regex.meta.meta_rgxs.META_RGXS: dict[str, Pattern]#

Dictionary of meta-regex patterns used for parsing and analyzing regular expressions: the primary decomposition patterns (set, group, atom), their second-order helpers (quant, set_operator, inline_flags, …), and the struct_mark pattern behind the RegexStore composition DSL. Each value is a compiled pattern, ready to match:

>>> from my import META_RGXS
>>> META_RGXS['quant'].search('ab{2,5}?cd')[0]
'{2,5}?'

I Building Blocks#

my.regex.meta.meta_rgxs.NO_ESC#

Lookbehind asserting that the preceding character is not an (unescaped) backslash escape.

my.regex.meta.meta_rgxs.NON_ESC#

matches a start-of-string, non-backslash, or double-escape.

Type:

Consuming counterpart of NO_ESC

my.regex.meta.meta_rgxs.QUANT#

An optional quantifier of any form (?, *+, {2,5}?, …), matched atomically.

my.regex.meta.meta_rgxs.FLAGS#

A named capture of inline-flag syntax (e.g. smi, i-x), as found inside (?...) groups.