Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions docs/reference/feature-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,13 @@ my @copy = @{$z}; # ERROR

## Regular Expressions
- ✅ **Basic Matching**: Operators `qr//`, `m//`, `s///`, `split` are implemented.
- 🟡 **Joni-only matcher migration**: Executable callbacks, conditions, recursion, control verbs, dynamic patterns, and the native-only syntax below execute through the vendored Joni fork. Ordinary patterns still use the temporary Java-first migration policy unless Joni is forced or required by the pattern. Owner: runtime backend policy. Gate: the same 80 regex files must have no PR 958 regression on forced-Joni JVM/interpreter runs before Java compiled-pattern variants, feature routing, and the developer selector are deleted.
- ✅ **Regex modifiers**: Modifiers `/p` `/i` `/m` `/s` `/n` `/g` `/c` `/r` `/e` `/ee` `/x` `/xx` are implemented.
- ✅ **Special variables**: The special variables `$1`, `$2`... are implemented.
- ✅ **Transliteration**: `tr` and `y` transliteration operators are implemented.
- ✅ **`pos`**: `pos` operator is implemented.
- ✅ **`\G`**: `\G` operator in regex is implemented.
- **`\N{name}`**: `\N{name}` and `\N{U+hex}` operator for named characters in regex is implemented.
- 🟡 **`\N{name}`**: Standard names, `\N{U+hex}`, and lexical `%^H{charnames}` callbacks execute through Joni. Multi-character and empty atoms, positive/negated classes, quantifier boundaries, semantic cache keys, stringification, runtime string patterns, and nested-scope restoration pass the system-Perl reducers on JVM and interpreter. Zero-length `\N{}` inside `(?[...])` still receives the adapter's generic empty-class diagnostic. Owner: native extended-class parser. Gate: unchanged `pat_advanced.t` charname assertions pass with that adapter path removed.
- ✅ **`\N`**: Not-newline operator.
- ✅ **lvalue `pos`**: lvalue `pos` operator is implemented.
- ✅ **`m?pat?`** one-time match is implemented.
Expand All @@ -372,33 +373,37 @@ my @copy = @{$z}; # ERROR
- ✅ **caret modifier**: `(?^` embedded pattern-match modifier, shorthand equivalent to "d-imnsx".
- ✅ **\b inside character class**: `[\b]` is supported in regex.
- ✅ **Vertical whitespace escapes**: Native Joni `\v` matches U+000A..U+000D, U+0085, U+2028, and U+2029; `\V` matches the complement. Direct and character-class forms match Perl, and `reg_posixcc.t` passes 2,560/2,560 on both execution backends.
- ✅ **Horizontal whitespace escapes**: Native Joni `\h` and `\H` use Perl's exact horizontal-whitespace set in direct and character-class forms, including scoped `/a` and `/aa`, without changing stock Ruby-syntax hexadecimal escapes.
- ✅ **Unicode boundary assertions**: `\b{gcb}`, `\b{sb}`, `\b{wb}`, and `\b{lb}` (and their `\B` forms) execute natively in Joni from reproducible pinned Perl 5.44 Unicode 17.0 data. The complete 239,866-assertion generated boundary corpus passes on both backends.
- ✅ **Variable Interpolation in Regex**: Features like `${var}` for embedding variables.
- ✅ **Non-capturing groups**: `(?:...)` is implemented.
- ✅ **Named Capture Groups**: Defining named capture groups using `(?<name>...)` or `(?'name'...)` is supported.
- ✅ **Backreferences to Named Groups**: Using `\k<name>` or `\g{name}` for backreferences to named groups is supported.
- ✅ **Relative Backreferences**: Using `\g{-n}` for relative backreferences.
- ✅ **Basic Unicode Properties**: Common `\p{...}` and `\P{...}` forms such as `\p{L}` execute through Joni. General_Category assignments now enter the forked Joni parser unchanged and resolve to pinned Perl ranges there.
- 🟡 **Perl Unicode Property Syntax**: Perl-specific properties execute through Joni. `Age`, cumulative `In`/`Present_In`, General_Category, Canonical_Combining_Class, Bidi_Class, Decomposition_Type, East_Asian_Width, Numeric_Value, Joining_Group, Block, Script, and Script_Extensions assignments are generated from pinned Perl 5.44 Unicode 17.0 data with loose and wildcard aliases, ordered missing defaults, official compact aliases and shortcuts, Script-versus-Script_Extensions policy, reserved or composite values, exact rationals, and Perl's generated decimal keyword aliases; `ASCII_Hex_Digit`/`AHex` accepts Perl's eight boolean value aliases. General_Category and standalone exact Age, `In`/`Present_In`, Block, Script, Script_Extensions, Canonical_Combining_Class, Bidi_Class, Decomposition_Type, East_Asian_Width, Numeric_Value, and Joining_Group assignments use Joni's range-resolver API with explicit per-family case-fold policy. No-fold properties inside composed character classes and wildcard values remain adapter-translated until Joni represents those syntax semantics natively. Other generated property/value aliases still have pinned acceptance/rejection gaps.
- 🟡 **Perl Unicode Property Syntax**: Perl-specific properties execute through Joni. `Age`, cumulative `In`/`Present_In`, General_Category, Canonical_Combining_Class, Bidi_Class, Decomposition_Type, East_Asian_Width, Numeric_Value, Joining_Group, Block, Script, Script_Extensions, Word_Break, Sentence_Break, and Vertical_Orientation use pinned Perl 5.44 Unicode 17.0 data with Perl loose aliases and explicit fold policy. Native signed-wide `All` and Unikemet-backed binary properties are implemented. The pinned gate currently passes 81,928/83,648 on each backend; 1,720 aliases, wildcard forms, membership cases, and diagnostics remain. Owner: `UnicodeResolver` plus Joni's character-property AST. Gate: 83,648/83,648 with byte-identical JVM/interpreter results and zero rejection regressions.
- ✅ **Possessive Quantifiers**: Quantifiers like `*+`, `++`, `?+`, and `{n,m}+`, which disable backtracking, are supported.
- ✅ **Atomic Grouping**: Use of `(?>...)` for atomic groups is supported.
- ✅ **`\K` assertion**: Keep left — in `s///`, text before `\K` is preserved; match variables reflect only the portion after `\K`. Ordinary KEEP assertions route through native Joni and no longer use the Java marker rewrite; the adapter still rejects KEEP inside lookaround until the Joni analyser emits Perl's diagnostic directly.
- ✅ **Preprocessor**: `\Q`, `\L`, `\U`, `\l`, `\u`, `\E` are preprocessed in regex.
- 🟡 **Extended bracketed classes**: `(?[...])` supports Perl set operations, but matcher-semantic parsing and composed-class fold policy still pass through the legacy adapter. Owner: Joni parser/compiler composed-class AST. Gate: native union, intersection, subtraction, negation, nesting, multi-character/empty `\N{}` diagnostics, and `pat_advanced.t` must pass with the adapter rule removed.
- 🟡 **`\K` assertion**: Keep left executes natively in Joni; substitutions and match variables exclude text before `\K`. KEEP inside lookaround is correctly rejected but still by an adapter guard. Owner: Joni analyser diagnostics. Gate: the positioned native diagnostic stack must pass after deleting the guard.
- 🟡 **Regex frontend and preprocessor retirement**: Perl source operations such as `\Q`, `\L`, `\U`, `\l`, `\u`, and `\E` are supported. Matcher-semantic and Java-only rewrites remain in `RegexPreprocessor` during migration. Owner: frontend scanner for source policy and Joni for matcher behavior. Gate: every rule is classified, matcher rules have native reducers, Java-only rewrites are deleted, and only documented source-policy scanning remains.
- ✅ **Overloading**: `qr` overloading is implemented. See also [overload pragma](#pragmas).
- ✅ **Python-style named groups**: `(?P<name>...)` and `(?P=name)` are parsed natively by Joni with Perl capture numbering, duplicate-name behavior, and malformed/unknown-name diagnostics.
- ✅ **Alpha assertion aliases**: `(*pla:...)`, `(*plb:...)`, `(*nla:...)`, `(*nlb:...)`, `(*atomic:...)`, and the corresponding long spellings are parsed natively by Joni with Perl nesting, capture numbering, backtracking, assertion-condition predicates, and malformed-form diagnostics.
- 🟡 **Underscored numeric regex escapes**: Joni natively parses Perl spellings such as `\x{0_0_4_1}` and `\o{0_0_1_0_1}` through U+10FFFF, including literal/class forms, bare high-octal UTF-8 code points, truncation behavior, and structural diagnostics. The frontend normalization remains for forced-Java compatibility; exact `use re 'strict'` diagnostics and Perl code points above U+10FFFF through signed IV max remain source-policy/representation debt.
- 🟡 **Underscored numeric regex escapes**: Joni natively parses Perl spellings such as `\x{0_0_4_1}` and `\o{0_0_1_0_1}`, including literal/class forms, bare high-octal values, signed-wide scalars, truncation, and structural diagnostics. Owner: Joni lexer; the frontend normalization exists only for forced-Java compatibility. Gate: exact default/`re strict` reducers pass after deleting that normalization.
- ✅ **Wide Perl regex scalars**: Perl literals, classes, ranges, subjects, escapes, and native property results preserve values above U+10FFFF through signed IV max using Joni's runtime-neutral wide-scalar representation rather than truncating to Java `int`.
- 🟡 **Regex compile warnings and `re strict` diagnostics**: Warning categories, `$SIG{__WARN__}`, exact text, marker offsets, source locations, and strict-versus-default acceptance remain incomplete on the forced-Joni path. The current gate passes 1,694/2,595 `reg_mesg.t` assertions on both backends. Owner: positioned Joni warning callbacks plus Perl source-policy rendering. Gate: 2,595/2,595 with exact JVM/interpreter TAP, category, fatality, and location parity.

- ✅ **Dynamically-scoped regex variables**: Provisional captures, `$^R`, `$^N`, match positions, and callback locals follow matcher paths and unwind on backtracking.
- ✅ **Recursive and Dynamic Patterns**: `(?R)`, `(?0)`, and runtime `(??{ code })` execute through Joni. Dynamic expressions may return strings or `qr//` values, nested alternatives participate in outer backtracking without changing outer grouping or capture numbering, and callback and pure-pattern recursion have engine-owned depth ceilings.
- ✅ **Backtracking Control Verbs**: `(*ACCEPT)`, `(*FAIL)`/`(*F)`, `(*PRUNE)`, `(*SKIP)`, `(*THEN)`, and `(*COMMIT)` execute through Joni with matcher-owned cut boundaries. Atomic groups `(?>...)` are supported.
- ✅ **Marks and named skip targets**: `(*MARK:NAME)` and its `(*:NAME)` shorthand, named `(*SKIP:NAME)`, `$REGMARK`, and `$REGERROR` execute through Joni and follow the selected backtracking path.
- ✅ **Regex Definitions**: `(?(DEFINE)...)` containers and numbered or named calls to their subpatterns execute through Joni.
- **Lookbehind Assertions**: Fixed and bounded variable-length positive and negative lookbehind assertions execute through Joni, including nested lookahead. Removing the remaining compatibility routing requires the complete lookbehind corpus and native diagnostics to pass.
- **Branch Reset Groups**: `(?|...)` resets capture numbering across alternatives and preserves mapped match variables.
- 🟡 **Lookbehind Assertions**: Fixed and bounded variable-length positive and negative lookbehind assertions execute through Joni, including nested lookahead. Ordinary lookbehind retains temporary Java compatibility routing. Owner: Joni parser/analyser. Gate: enforce Perl's 255-character ceiling and pass folded-class, nested-assertion, and `(*ACCEPT)`-reachable widths in the 27-assertion four-leg reducer plus all six imported owner files before removing the route.
- 🟡 **Branch Reset Groups**: `(?|...)` resets capture numbering across alternatives and preserves mapped match variables, but subroutine-call combinations retain a temporary automatic-Java guard. Owner: Joni parser plus physical/logical capture maps. Gate: named, numeric, and relative-call reducers preserve lexical physical targets across alternatives and the imported branch-reset corpus passes after deleting the guard.
- ✅ **Advanced Subroutine Calls**: Sub-pattern calls with numbered or named references like `(?1)` and `(?&name)` execute through Joni.
- ✅ **Conditional Expressions**: Numbered and named capture conditions, positive and negative assertion conditions, recursion conditions `(?(R))`, `(?(R1))`, and `(?(R&name))`, executable callback conditions, and optimistic predicates execute through Joni.
- 🟡 **Extended Unicode Regex Features**: Complete pinned Script, Script_Extensions, and Block sets, `Extended_Pictographic`, `Age`, `In`/`Present_In`, General_Category, Canonical_Combining_Class, Bidi_Class, Decomposition_Type, East_Asian_Width, Numeric_Value, Joining_Group, and invalid-property gates execute through Joni, and `regexp_unicode_prop.t` passes 1,110/1,110. Current generated evidence is 377,602/407,367: the complete boundary corpus passes, while chunks 01–04 expose the remaining property/value alias gaps.
- 🟡 **Extended Unicode Regex Features**: Pinned Script, Script_Extensions, Block, `Extended_Pictographic`, `Age`, `In`/`Present_In`, General_Category, enumerated-property families, Unikemet properties, and invalid-property gates execute through Joni; `regexp_unicode_prop.t` passes 1,110/1,110 and boundary chunks 05–10 pass completely. Remaining generated aliases, wildcard AST ownership, membership mismatches, and composed-class fold closure share the 83,648-assertion Unicode gate above.
- ✅ **Extended Grapheme Clusters**: Native `\b{gcb}`/`\B{gcb}` implement GB1–GB13 and GB999, and `\X` includes repeated GB9c Indic conjuncts. The complete 8,516-assertion GCB/`\X` section of authoritative chunk 05 passes identically on JVM and interpreter.
- ✅ **Unicode Sentence Boundaries**: Native `\b{sb}`/`\B{sb}` implement SB1–SB11 and SB998 from the reproducible Perl 5.44 Unicode 17.0 sentence-break table. Authoritative chunk 05 passes 14,976/14,976 identically on JVM and interpreter.
- ✅ **Unicode Word Boundaries**: Native `\b{wb}`/`\B{wb}` implement WB1–WB16 and WB999 from reproducible Perl 5.44 Unicode 17.0 word-break and extended-pictographic tables. Authoritative chunk 10 passes 19,510/19,510 identically on JVM and interpreter.
Expand All @@ -407,7 +412,7 @@ my @copy = @{$z}; # ERROR
- ✅ **Regex Debugging**: Lexically scoped `use/no re 'debug'` and `debugcolor` are supported, including runtime snapshot ownership.
- ✅ **Runtime Regex Evaluation**: `use re 'eval'` controls whether interpolated patterns containing eval groups may compile. Admitted runtime source is compiled into lexical callback closures and preserves its package, visible lexical cells, Unicode or byte source type, default regex modifiers, and match-once state. Literal callbacks, interpolated `qr//` values (including local, referenced, and tied arrays), raw runtime eval groups, callback conditions, and standalone `(?(DEFINE)...)` containers may be composed in one Joni pattern; dynamic callbacks may return further admitted executable source.
- ✅ **Regex Compilation Flags**: Lexically scoped default flags from `use/no re '/imsx'` are applied to literal, interpolated, and runtime-compiled regex values.
- ✅ **Perl capture and ASCII fold modifiers**: Top-level and scoped `/n` suppress unnamed captures, while `/a` and `/aa` apply Perl ASCII class and ASCII-strict case-fold semantics inside Joni, including restoration across nested modifier groups.
- ✅ **Perl capture and ASCII fold modifiers**: Top-level and scoped `/n` suppress unnamed captures. `/a` and `/aa` apply Perl ASCII class and ASCII-strict case-fold policy inside Joni and restore it across nested modifier groups. The exact 837-assertion `/aa` envelope is byte-identical across automatic/forced JVM/interpreter cells, and the temporary Java fold route is removed.
- ✅ **Perl Named Captures**: Names may contain underscores, and duplicate named groups preserve Perl-style `%+`/`%-` and backreference behavior.


Expand Down