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
@vmihailenco Thanks for the report, and apologies for the six-week silence — I somehow missed the notification and only caught this when reviewing the repo today. In parallel with coregex I've been developing a headless IDE (open-sourcing soon) for managing large Go codebases like GoGPU via MCP — think console GoLand with AI automation — along with daemon, fursy and relica.
Confirmed and root-caused.^x(a|bc) is the tip of two bugs in the anchored fast paths. Both produce wrong answers on common pattern shapes (routers, HTTP version checks, SemVer). The submatch path is not affected; Match, Find, FindAll, Count and ReplaceAll are.
1. BranchDispatch ignores everything around the alternation.IsBranchDispatchPattern accepts any anchored concat that contains an alternation, but the dispatcher assumes the alternation starts at position 0 and ends the pattern:
2. First-byte extraction ignores FoldCase.regexp/syntax rewrites [Vv] as (?i:V); the extractor takes only the uppercase rune, so the fast-reject path discards lowercase input:
^[Vv]\d+ "v1" → false ("V1" → true)
Fix is in progress; I'll link the PR here and cut a patch release as soon as it lands. It will also add a cross-API invariant test for anchored patterns — MatchString(s) == (FindStringIndex(s) != nil) == (FindStringSubmatchIndex(s) != nil) — which is exactly the signal this class of bug produces.
Activity
kolkov commentedon Oct 8, 2026
@vmihailenco Thanks for the report, and apologies for the six-week silence — I somehow missed the notification and only caught this when reviewing the repo today. In parallel with coregex I've been developing a headless IDE (open-sourcing soon) for managing large Go codebases like GoGPU via MCP — think console GoLand with AI automation — along with daemon, fursy and relica.
Confirmed and root-caused.
^x(a|bc)is the tip of two bugs in the anchored fast paths. Both produce wrong answers on common pattern shapes (routers, HTTP version checks, SemVer). The submatch path is not affected;Match,Find,FindAll,CountandReplaceAllare.1. BranchDispatch ignores everything around the alternation.
IsBranchDispatchPatternaccepts any anchored concat that contains an alternation, but the dispatcher assumes the alternation starts at position 0 and ends the pattern:2. First-byte extraction ignores FoldCase.
regexp/syntaxrewrites[Vv]as(?i:V); the extractor takes only the uppercase rune, so the fast-reject path discards lowercase input:Fix is in progress; I'll link the PR here and cut a patch release as soon as it lands. It will also add a cross-API invariant test for anchored patterns —
MatchString(s) == (FindStringIndex(s) != nil) == (FindStringSubmatchIndex(s) != nil)— which is exactly the signal this class of bug produces.kolkov commentedon Oct 9, 2026
Fixed in v0.12.27 — PR #172.