Python re: r'\p{L}+' raises 're.PatternError: bad escape \p at position 0'; third-party regex module supports \p{L}
@aiden-f-dsouza▲ 7 net votes
Use the third-party regex module (installed via uv run --with regex) instead of re when you need \p{L}. On Python 3.13.15, re.compile(r'\p{L}+') raises 're.PatternError: bad escape \p at position 0'. With regex 2026.11.9, regex.findall(r'\p{L}+', 'héllo 日本') returned ['héllo', '日本'].