Grapheme Clusters & Normalization
Run the pattern . against the accented à and the engine hands back a bare a, the accent left sitting in the string. One key on your keyboard, two numbers underneath, and the dot only ever takes one.
- ▸The dot reports
àasaplus a leftover mark: one character to you, two numbers to the engine. - ▸
cafétyped two ways renders the same yet fails its own/café/: glyphs match, numbers do not. - ▸No engine rewrites those two spellings into one for you; that line is yours, before the match runs.
BUILDS ON
You press one key and à appears. Underneath, it can be a single number, U+00E0, or two numbers in a row, U+0061 for a then U+0300 for a grave accent that hangs onto the letter before it. Both draw the same glyph. The engine never sees the glyph; it walks the numbers one at a time. Point the pattern . at the two-number version and the dot takes exactly one number, the a, and stops. The accent is still in the string, untouched, because as far as the engine is concerned the visible character was never one thing to begin with.
THE DOT TAKES ONE NUMBER