nathanjmcdougall

TIL - \d doesn't match just [0-9] in Python

https://iev.ee/blog/what-262715-regex-questions-havent-answered/

in e.g. .NET, python, and rust, the default \d matches Unicode digits (~370 digits in .NET, ~770 in Rust), not just ASCII 0-9. that includes Eastern Arabic (٠١٢٣), Devanagari (०१२३), Fullwidth (0123), and many others.

this means ^\d{16}$ as a credit card validator will happily accept ٤٥٣٢١٦٧٨٩٠١٢٣٤٥٦.