You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: FindAllIndex vs FindAllSubmatchIndex return different match boundaries #176
FindAllIndex and FindAllSubmatchIndex can return different match boundaries for the same pattern and input, violating the invariant that both should agree on match positions.
Repro
re:=coregex.MustCompile(`c?[[:alpha:]]{2}`)
input:=" abccBy "idx:=re.FindAllStringIndex(input, -1)
fmt.Println("FindAllIndex:", idx)
// coregex: [[1 3] [3 5] [5 7]] — took empty c? at each positionsubIdx:=re.FindAllStringSubmatchIndex(input, -1)
fmt.Println("FindAllSubmatchIndex:", subIdx)
// coregex: [[1 3] [3 6]] — correctly took c at position 3// stdlib: [[1 3] [3 6]]
FindAllIndex and FindAllSubmatchIndex must return identical match boundaries (the first two indices of each submatch entry must equal the corresponding index entry).
Leftmost-first semantics: the engine must find the match that starts earliest, regardless of which code path is used.
Context
The two-phase search architecture (Phase 1: DFA finds boundaries, Phase 2: PikeVM extracts captures) can use different match logic than the single-phase PikeVM path. Patterns with optional prefixes expose the divergence.
Activity
test: remove D-class fuzz whitelists, add invalid UTF-8 seeds (#179)
feat: invalid UTF-8 bytes match as U+FFFD width 1 (#182)