Handle Unicode text, emoji, encoding, normalization, code points, and safe storage.
Lessons
Use the u flag and \p{...} property escapes.
Unicode-Aware Regex is easiest to learn by reading the example, changing it, and observing the result.
// The 'u' flag enables code-point-aware matching and \p{...}
const text = 'Price: 9€ 😀 日本';
console.log(text.match(/\p{Letter}+/gu)); // ['Price', '日本']
console.log(text.match(/\p{Emoji}/gu)); // ['😀']
console.log(text.match(/\p{Currency_Symbol}/gu));// ['€']
// Match a full emoji grapheme
console.log('👍🏽'.match(/\p{Emoji}(\p{Emoji_Modifier})?/u));Practice the Unicode-Aware Regex example in a small scratch file, then explain what changed and why.