limitations/re.md
re moduleMonty's re module is backed by the Rust fancy-regex crate, not
CPython's regex engine. Most patterns behave identically, but the
underlying engine differs in syntax extensions and error reporting.
Implemented: compile, search, match, fullmatch, findall, sub,
split, finditer, escape.
Not implemented: subn, purge, template. The pre-compiled re._compile
internal is not exposed.
Supported: NOFLAG, IGNORECASE / I, MULTILINE / M, DOTALL / S,
ASCII / A.
Not implemented: VERBOSE / X, LOCALE / L, DEBUG, UNICODE / U
(Unicode is always on). Passing an unknown flag bit is silently accepted.
re.Pattern objectsAttributes: pattern, flags.
Methods: search, match, fullmatch, findall, sub, split,
finditer.
Not implemented: subn, groups (count), groupindex (named-group
mapping), scanner. The pos / endpos arguments accepted by
Pattern.search(string, pos, endpos) etc. in CPython are not supported.
re.Match objectsAttributes: re, string.
Methods: group, groups, groupdict, start, end, span.
Not implemented: lastindex, lastgroup, expand, pos, endpos,
regs. Indexing (m[0], m["name"]) is not supported — use .group().
re.PatternError / re.errorRaised for invalid regex patterns. Unlike CPython, pattern, pos,
lineno, and colno attributes are not populated — fancy-regex's error
representation does not carry them.
re.PatternError at compile time.\10 and higher is not recognized; only \1–\9.fancy-regex and do not
match CPython's wording.