May 2017 Archives

\d does not validate numbers

points us to this Perl FAQ:

Unfortunately, the regular expression part of the above FAQ page is wrong. \d doesn't validate numbers, unless you have already verified that your input contains only ASCII characters.

What \d does is to validate whether a number is regarded as a numeral in Unicode. For example, \d will happily match things like U+07C2: '߂' NKO …

About Ben Bullock

user-pic I blog about Perl.