Features#

New here? Getting started is the first hour: install and a first match.

Every construct REAL accepts, rejects, or extends beyond Python re — one row, one status. Excluded by design is a closed door, not a missing feature: each of those constructs makes matching super-linear and would reopen the ReDoS door this engine exists to close — rationale on the divergences page.

Core

Construct

Status

Notes

Literals, concatenation & alternation

supported

the base regular-language operators — abc|xyz

. any character (ECMAScript semantics)

supported

excludes \n and \r under the compat/ECMAScript grammar — a.b

Character classes & ranges [a-z]

supported

compiled to the canonical UTF-8-ranges automaton in code-point mode — [a-z0-9_]+ (details)

\d \w \s shorthand classes (+ negations)

supported

Unicode-aware in text mode, ASCII under flags::ascii/bytes mode — \d+\w*\s? (details)

Anchors ^ $ \b \B

supported

\b/\B on an empty region follow Python 3.11+ by-definition semantics — ^\bfoo\b$ (details)

Quantifiers * + ? {m,n} (greedy/lazy)

supported

compiled to the bounded, linear Thompson/Pike VM — a+?b*

Groups (capturing, non-capturing, named)

supported

capture is write-only – there is no backreference to read it — (?P<x>a)(?:b)

Lookahead & lookbehind (bounded)

supported

REAL’s ReDoS-safe bounded lookaround — (?<=a)b(?=c)

Possessive quantifiers a*+ a++ a?+ a{n,m}+

supported

over a single atom, or one wrapped in one capturing group – linear, ReDoS-safe; re 3.11+/PCRE2 parity, RE2/Rust regex/Go regexp reject the syntax; a compound body is planned — a++b (details)

Atomic groups (?>...)

supported

single atom or one-capture body – linear; re 3.11+/PCRE2 parity, RE2/Rust reject; compound body planned — (?>ab)c (details)

ASCII case-insensitive matching (icase)

supported

byte-for-byte ASCII fold; Unicode-aware folding is a text-mode extension of this — (?i)ABC

Multiline mode (^/$ per line)

supported

re-parity; $ includes a trailing \n under multiline — (?m)^a$

Unicode

Construct

Status

Notes

\p{…} property classes

supported

General_Category + Script + Script_Extensions + the standard binary properties; native, linear klass_cp; a REAL superset – re rejects \p outright; sc=/scx= accept both the long name (Latin) and the short UAX24/ISO 15924 code (Latn); other UAX44 properties (Bidi_Class, Word_Break, Age, …) stay unsupported\p{L}+ (details)

\N{NAME} named characters

supported

binding resolves the name via unicodedata (no C++ table) (details)

\N{U+XXXX} scalar form

extension

PCRE2-style; uniform C++/Python surfaces – re knows only names — \N{U+1F600} (details)

Anchors & lookaround extensions

Construct

Status

Notes

\z end-of-text anchor

supported

exact alias of \Z (Python 3.14’s meaning) — abc\z

Variable-width lookbehind (?<=a|bb)

extension

bounded, so still linear; re/PCRE reject it as non-fixed-width — (?<=a|bb)x (details)

Word-edge anchors \< \>

extension

word-start / word-end; re has no such escape — \<word\> (details)

Escapes & classes

Construct

Status

Notes

Octal escapes in a class [\1] [\12]

supported

every \digit is octal in a class body (no backreferences there) — [\12]

POSIX [[:alpha:]] classes

supported

exact re-parity: read as a literal class (matches re’s FutureWarning-era behaviour), not true POSIX semantics — [[:alpha:]]+

Flags

Construct

Status

Notes

Global flags i m s x a (and (?imsxa) prefix)

supported

re semantics; re.U is a no-op, re.L excluded — (?imsxa)a.b

Scoped inline flags (?imsxa:…) / (?-…:…) / (?…-…:…)

supported

per-scope i m s x a (Python 3.11 semantics), exact re-parity in str and bytes — (?i:abc)(?-i:def)

Excluded by design

Construct

Status

Notes

Backreferences (a)\1, (?P=n)

excluded by design

non-regular -> super-linear -> ReDoS — (a)\1 (details)

Conditional groups (?(id)…), recursion, callouts

excluded by design

non-regular control flow -> ReDoS — (?(1)a|b) (details)