\d less efficient than [0-9]
stackoverflow.com
\d less efficient than [0-9]
1–10 of 80 posts
Re: \d less efficient than [0-9]
#2Short answer: \d includes all the Unicode characters from http://www.fileformat.info/info/unicode/category/Nd/list.htm
Re: \d less efficient than [0-9]
#3Short answer: \d includes all the Unicode characters from http://www.fileformat.info/info/unicode/category/Nd/list.htm
...at least in C# regexes.
Re: \d less efficient than [0-9]
#4Short answer: \d includes all the Unicode characters from http://www.fileformat.info/info/unicode/category/Nd/list.htm
Is that actually a good thing? If I'm using \d to validate numbers (for example to check before string to int conversion, or IP address, phone number, or any other use), other unicode digits are not helpful to me.
It's great to support unicode, but I don't think the \d should have been extended this way. Add a \ud or something.
Re: \d less efficient than [0-9]
#5Re: \d less efficient than [0-9]
#6in C#
Re: \d less efficient than [0-9]
#7[deleted]
Re: \d less efficient than [0-9]
#8Short answer: \d includes all the Unicode characters from http://www.fileformat.info/info/unicode/category/Nd/list.htm
oh wow I had no idea that "full width digits" can actually be handled properly. (U+FF10 ~ U+FF19)
Re: \d less efficient than [0-9]
#9I was a bit surprised that Perl does not seem to be matching Unicode digits. Anyone know why?
$ echo '0' | perl -pe 'print "yes: " if m/\d/'
yes: 0
$ echo '੧' | perl -pe 'print "yes: " if m/\d/'
੧Re: \d less efficient than [0-9]
#10I wonder what kind of security vulnerabilities could be looming in validators not expecting non-ascii 0-9 digits and using this regex?