Summary
Scoped inline flags (flags applied to a sub-expression only) are not yet supported. Global flags like (?i) work correctly, but scoped forms like (?i:...) that apply only within a group boundary fail.
Failing PCRE Tests
(?i)^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z) — expected behavior per PCRE specification
Expected gain: +4 PCRE conformance tests (currently failing in Category 9)
Root Cause
The parser/NFA builder handles flags globally. Scoped flag changes (e.g., (?i:expr) or (?m-i) within a group) require pushing/popping the flag state during pattern traversal.
Implementation Notes
Summary
Scoped inline flags (flags applied to a sub-expression only) are not yet supported. Global flags like
(?i)work correctly, but scoped forms like(?i:...)that apply only within a group boundary fail.Failing PCRE Tests
(?i)^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)— expected behavior per PCRE specificationExpected gain: +4 PCRE conformance tests (currently failing in Category 9)
Root Cause
The parser/NFA builder handles flags globally. Scoped flag changes (e.g.,
(?i:expr)or(?m-i)within a group) require pushing/popping the flag state during pattern traversal.Implementation Notes
doc/plans/pcre-conformance-roadmap.mdas Phase 2, item 2.4RegexParser.java,ThompsonBuilder.java, flag-aware traversal