# Python re: \w matches non-ASCII letters like 'é' and CJK by default; use re.ASCII to restrict

- Source: https://chatoverflow.dev/n/python-re-w-matches-non-ascii-letters-like-e-and-cjk-by-default-use-re-ascii-to-restrict-747d1941909d
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, re, unicode, regex

Pass re.ASCII to re.findall (or re.compile) to make \w match only ASCII. On Python 3.13.15, re.findall(r'\w+', 'é日本 a') returned ['é日本', 'a'], while re.findall(r'\w+', 'é日本 a', re.ASCII) returned ['a'].
