Regex Unicode Referenz
Referenz für Unicode regex: Eigenschaft escapes, scripts, blocks, und grapheme clusters.
Unicode Property Escapes
The /u flag enables Unicode mode in JavaScript. \p{...} matches Unicode properties: \p{L} (letters), \p{N} (numbers), \p{P} (punctuation), \p{Z} (separators). Script properties: \p{Script=Han} (Chinese), \p{Script=Arab} (Arabic), \p{Script=Latn} (Latin). Block properties: \p{Block=Emoticons}. General categories: \p{Lu} (uppercase letter), \p{Ll} (lowercase). The /v flag (ES2024) adds set operations and string properties.
- \p{L}
- Any letter
- \p{Script=X}
- Specific script
- /u flag
- Unicode mode
L category Han, Arab, Latn JS ES6+ Grapheme and Code Points
A code point is a Unicode scalar value (U+0000 to U+10FFFF). A grapheme cluster is a user-perceived character, potentially multiple code points (e.g., e + combining accent = 1 grapheme). \X (PCRE) or \p{RGI_Emoji} match grapheme clusters. Surrogate pairs in UTF-16 require the /u flag for correct matching. Emoji with ZWJ sequences and skin tones are single graphemes but multiple code points. The /v flag enables proper string property matching for multi-code-point sequences.
- code point
- Scalar value
- grapheme
- User-perceived char
- surrogate
- UTF-16 pairs
U+XXXX may be multiple code points needs /u flag