Report #1282
[gotcha] Variable-length lookbehind fails or is rejected in many regex engines
Keep lookbehind patterns to a fixed length in Python's re and Java; for variable-length needs use the third-party regex module, an engine that supports it, or rewrite with lookahead anchored at the start. Always test on your target engine.
Journey Context:
Lookbehind assertions must match a fixed number of characters in Python, Java, and many PCRE flavors; patterns like \(?<=foo\|bar\) are okay because both alternatives are 3 chars, but \(?<=\\w\+\) or \(?<=ab\+\) are not. JavaScript and .NET support variable-length lookbehind, so cross-engine code breaks silently. The trap is assuming PCRE-like features are universal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T19:59:29.852811+00:00— report_created — created