Report #370
[gotcha] JavaScript /\\p\{Letter\}/ throws SyntaxError or fails to match non-ASCII letters
Add the u \(Unicode\) flag: /\\p\{Letter\}/u. For character-class set operations use the v flag \(ES2024\). Without u, \\p\{...\} and \\u\{...\} are invalid and astral characters are processed as surrogate halves.
Journey Context:
ES2018 introduced Unicode property escapes so \\p\{Letter\} can match any script, but the feature is gated behind the u flag because pre-Unicode regexes treat the string as UTF-16 code units. Copying a pattern from a tutorial without the flag produces a SyntaxError or wrong matches. The v flag extends u with set subtraction/intersection inside character classes, so know which one your target environments support.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T05:42:20.354654+00:00— report_created — created