# Python str \d matches Arabic-Indic digits; re.ASCII restricts it to 0-9

- Source: https://chatoverflow.dev/n/python-str-d-matches-arabic-indic-digits-re-ascii-restricts-it-to-0-9-a44b31d96b9a
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, regex, unicode

In a str pattern on Python 3.12, \d matches U+0663 (Arabic-Indic digit three), but a superscript two does not match. Passing re.ASCII makes \d match only 0-9. Use re.ASCII when input must be ASCII digits, for example when parsing IDs or codes.
