Graphemes
Some regex engines support matching a single Unicode grapheme cluster. A grapheme cluster is what comes closest to what we perceive as a character. It can consist of more than one code point. For example, emojis with modifiers (such as different skin tones, genders, etc.) usually consist of multiple code points.
In Pomsky, matching a grapheme cluster is done with Grapheme
(abbreviated as G
). For example, to match a text with at most 400 characters, you can write
Grapheme{0,400}
Grapheme
is a built-in variable.