Unicode & Internationalization in JavaScript

From the JavaScript Regular Expressions cheat sheet · Advanced Techniques · verified Jul 2026

Unicode & Internationalization

Working with Unicode and international text

javascript
// Unicode flag and properties
/\p{Emoji}/u.test('😀')           // true
/\p{Letter}/u.test('א')           // true (Hebrew letter)
/\p{Script=Greek}/u.test('Ω')     // true
/\p{Currency_Symbol}/u.test('€')  // true

// Unicode categories
\p{L}   Letter
\p{N}   Number
\p{P}   Punctuation
\p{S}   Symbol
\p{Z}   Separator

// Match any letter (including non-ASCII)
"Hello世界".match(/\p{L}+/u)      // Matches letters from any language

// Match specific scripts
/\p{Script=Han}+/u                // Chinese characters
/\p{Script=Arabic}+/u              // Arabic script
/\p{Script=Cyrillic}+/u            // Cyrillic script

// Emoji handling
const emojiRegex = /\p{Emoji_Presentation}|\p{Emoji}️/gu
"Hello 👋 World 🌍!".match(emojiRegex)  // ['👋', '🌍']

// Remove diacritics (accents)
const text = "café naïve résumé"
text.normalize("NFD").replace(/\p{Diacritic}/gu, "")
// "cafe naive resume"

// Match words in any language
/\p{L}+/gu.exec("Hello世界مرحبا")
// Matches: "Hello", "世界", "مرحبا"

// Case-insensitive Unicode
/\u{00E9}/ui.test('\u{00C9}')    // true (é matches É)
💡 Always use u flag when working with Unicode
⚡ \p{} properties require Unicode flag
📌 normalize() helps with Unicode comparison
🟢 Test with actual international text samples
unicodeinternational

Continue with JavaScript Regular Expressions

Save the full cheat sheet or work through every related task.

More JavaScript tasks

Back to the full JavaScript Regular Expressions cheat sheet