Unicode Regex Builder & Property Escape Studio
Build and debug ECMAScript Unicode property escapes (\p{sc=Arabic}, \p{L}, \p{Extended_Pictographic}) with visual rule blocks and real-time glyph dissection.
Visual Rule Builder (Click to Assemble Unicode Expressions)
Match Details & Codepoint Dissection (12 Matches)
| # | Matched Text | Position | Codepoints | Action |
|---|---|---|---|---|
| 1 | Unicode | Pos 0 | U+0055 U+006E U+0069 U+0063 U+006F U+0064 U+0065 | |
| 2 | Test | Pos 13 | U+0054 U+0065 U+0073 U+0074 | |
| 3 | Hello | Pos 19 | U+0048 U+0065 U+006C U+006C U+006F | |
| 4 | World | Pos 25 | U+0057 U+006F U+0072 U+006C U+0064 | |
| 5 | Full | Pos 32 | U+0046 U+0075 U+006C U+006C | |
| 6 | stack | Pos 37 | U+0073 U+0074 U+0061 U+0063 U+006B | |
| 7 | text | Pos 43 | U+0074 U+0065 U+0078 U+0074 | |
| 8 | processing | Pos 48 | U+0070 U+0072 U+006F U+0063 U+0065 U+0073 U+0073 U+0069 U+006E U+0067 | |
| 9 | with | Pos 59 | U+0077 U+0069 U+0074 U+0068 | |
| 10 | chars | Pos 72 | U+0063 U+0068 U+0061 U+0072 U+0073 | |
| 11 | prices | Pos 97 | U+0070 U+0072 U+0069 U+0063 U+0065 U+0073 | |
| 12 | emojis | Pos 111 | U+0065 U+006D U+006F U+006A U+0069 U+0073 |
Unicode Regular Expressions & Property Escapes Ready to Run
Modern ECMAScript regex with Unicode u/v flags and property escapes.
The Modern Architecture of Unicode Regular Expressions
Traditional ASCII regular expressions (like [a-zA-Z] and \w) fail completely in modern multi-lingual applications. An expression written with [a-zA-Z] will never match Urdu Nastaliq (کتاب), Arabic (سلام), Hindi Devanagari (नमस्ते), or modern emojis.
ECMAScript 2018+ and PCRE engines introduce native property escapes. Using \p{L} matches all letters across 168 writing systems. Using \p{sc=Arabic} specifically isolates Perso-Arabic text without hardcoding thousands of raw hex offsets.
The v flag (standardized in ECMAScript 2024) upgrades the classic u flag. It supports set subtraction and set intersection (e.g. [\p{sc=Arabic}&&\p{L}]) and matches multi-character strings such as flags and emoji ZWJ modifier sequences.
Frequently Asked Questions (FAQs)
What is the difference between the "u" and "v" flags in JavaScript Regular Expressions?+
The "u" flag (Unicode mode) treats strings as sequences of 21-bit Unicode codepoints rather than 16-bit code units, enabling \p{...} escapes. The newer "v" flag (Unicode Sets mode) adds set operations (intersection && and subtraction --) and proper matching of multi-character strings like emoji sequences.
How do I match all emojis in a string using regular expressions?+
The most accurate pattern is \p{Extended_Pictographic}+ with the "u" (or "v") flag. Unlike older regexes that used hardcoded surrogates, \p{Extended_Pictographic} automatically includes all new emojis in modern Unicode versions.
Why does \w not match Urdu, Arabic, or Hindi words?+
In standard regex engines without Unicode flags, \w is strictly equivalent to [a-zA-Z0-9_]. To match non-Latin words in any language, use \p{L}+ instead.
How can I match only Arabic or Urdu text without English letters?+
Use \p{sc=Arabic}+ or \p{Script=Arabic}+ with the "u" flag. This matches letters, vowels, and diacritics specific to Perso-Arabic scripts.
Can I export regex patterns tested here into Python, Go, or Rust?+
Yes! Check our Developer Code Snippets tab at the bottom of this tool for ready-to-use boilerplate in Python (regex), Go (regexp), Rust, PHP, and TypeScript.