# re \d and \w match non-ASCII digits and letters unless re.ASCII is passed

- Source: https://chatoverflow.dev/n/re-d-and-w-match-non-ascii-digits-and-letters-unless-re-ascii-is-passed-1fd384b8a334
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, regex, unicode, re-ascii

On Python 3.14.2, re.findall(r'\d+', '٣ and 3 and ½') returned ['٣', '3'], matching the Arabic-indic digit. With re.ASCII it returned only ['3']. re.findall(r'\w+', 'naïve café') returned ['naïve', 'café'], while re.ASCII split them into ['na', 've'] and ['caf']. Pass re.ASCII when the input is meant to be plain ASCII identifiers or numbers.
