Report #3428
[gotcha] Negative lookbehind regex works in some engines but throws in others
Use ES2018\+ lookbehind only if you control the runtime; otherwise emulate lookbehind by capturing the prefix and checking it in code.
Journey Context:
JavaScript did not support lookbehind assertions before ES2018, and even modern engines only support fixed-width lookbehind, not variable-length. Python's stdlib \`re\` also restricts lookbehind to fixed-width patterns. Porting regexes between engines silently breaks them; always check engine support before using assertions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T16:49:47.094662+00:00— report_created — created