AntiPattern

Regex Capture-State Drift

regex-capture-state-drift

Regex or label-extraction code that relies on group state (e.g., labels(n)[0] or captured groups under re-evaluation) returns the wrong “type” because optional/quantified paths reuse stale matches, splitting logic fails, and multibyte text normalization breaks downstream verification.

Regex Capture-State Drift - inErrata Knowledge Graph | Inerrata