Skip to main content
I
Uni
UNICODE
Tools/Unicode Regex Builder

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.

12Matched Sequences
/\p{L}+/guActive Regex Rule
116Test Buffer Codepoints
u (Unicode)ECMAScript Mode

Visual Rule Builder (Click to Assemble Unicode Expressions)

Quantifier:
//
Flags:
Font Size (16px):
1. Raw Editable Test Buffer
2. Live Match Highlighter & Glyph Dissection12 matches detected
Unicode 16.0 Test: Hello World! Full-stack text processing with 154,998 chars, €100 / $50 / ¥500 prices & 🚀💖 emojis.

Match Details & Codepoint Dissection (12 Matches)

#Matched TextPositionCodepointsAction
1UnicodePos 0U+0055 U+006E U+0069 U+0063 U+006F U+0064 U+0065
2TestPos 13U+0054 U+0065 U+0073 U+0074
3HelloPos 19U+0048 U+0065 U+006C U+006C U+006F
4WorldPos 25U+0057 U+006F U+0072 U+006C U+0064
5FullPos 32U+0046 U+0075 U+006C U+006C
6stackPos 37U+0073 U+0074 U+0061 U+0063 U+006B
7textPos 43U+0074 U+0065 U+0078 U+0074
8processingPos 48U+0070 U+0072 U+006F U+0063 U+0065 U+0073 U+0073 U+0069 U+006E U+0067
9withPos 59U+0077 U+0069 U+0074 U+0068
10charsPos 72U+0063 U+0068 U+0061 U+0072 U+0073
11pricesPos 97U+0070 U+0072 U+0069 U+0063 U+0065 U+0073
12emojisPos 111U+0065 U+006D U+006F U+006A U+0069 U+0073

Unicode Regular Expressions & Property Escapes

Modern ECMAScript regex with Unicode u/v flags and property escapes.

1// JavaScript (ES2024 with Unicode Property Escapes)
2const text = "Hello world! یہ ایک اردو جملہ ہے with 154,998 chars & 🚀💖 emojis.";
3
4// 1. Match all Unicode Letters in any language (Latin, Arabic, Devanagari, etc.)
5const letterRegex = /\p{L}+/gu;
6const letters = text.match(letterRegex);
7console.log("Words matched:", letters);
8
9// 2. Match Perso-Arabic Script specifically
10const arabicRegex = /\p{sc=Arabic}+/gu;
11const urduWords = text.match(arabicRegex);
12console.log("Urdu/Arabic text:", urduWords);
13
14// 3. Match Modern Extended Emojis
15const emojiRegex = /\p{Extended_Pictographic}+/gu;
16const emojis = text.match(emojiRegex);
17console.log("Emojis:", emojis);
TypeScript / Node.jsZero external runtime dependencies • Standard Library
UTF-8 & Unicode 16.0 Compatible

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.

Unicode Property Escapes (\p{...}):

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 New ECMAScript v Flag (Sets Mode):

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.