コンテンツへスキップ
uencoder

Regex Unicode リファレンス

リファレンス 用 Unicode regex: プロパティ escapes, scripts, blocks, および 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
L category
\p{Script=X}
Specific script
Han, Arab, Latn
/u flag
Unicode mode
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
U+XXXX
grapheme
User-perceived char
may be multiple code points
surrogate
UTF-16 pairs
needs /u flag

関連ツール

参考链接