4 ms·
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 ot
by ars 14y ago
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.
- Tuna-Fish 14y agoGiven that the category is specifically "decimal digit", I think it's good, so long as the number parsing code accepts them all too.
- dllthomas 14y agoYes. Assuming that, it's good. I think that assumption is likely to be invalid in many cases, though.
- bellbind 14y agoIf you use a preg engine you can add the /a modifier which excludes unicode chars from matches.
- chebucto 14y agoMaybe specify the subset of unicode you're expecting in the headers, and have the compiler do the nitty gritty?
- rmc 14y agoYes it's a good thing. There are other places in the world that don't just use ascii. If you want European style numbers just use [0-9]