4 ms·
You got me curious about grapheme matching in Python with regex. It looks like it is not in the stdlib yet with 3.3. However, it you install https://pypi.python
by wbond 13y ago
You got me curious about grapheme matching in Python with regex. It looks like it is not in the stdlib yet with 3.3. However, it you install https://pypi.python.org/pypi/regex https://pypi.python.org/pypi/regex and then replace:
import re
with
import regex as re
Then if you want to get into using graphemes slicing, you could use something like:
import regex as re
decomposed_str = 'o\u0308o\u0327'
graphemes = re.findall('(\\X)', decomposed_str)
sub_graphemes = grapheme[1:]
decomposed_substr = ''.join(sub_graphemes)