From: "Chas. Owens" <[EMAIL PROTECTED]> > 2008/4/3 Jay Savage <[EMAIL PROTECTED]>: > snip > > Exactly. The functionality is there to be taken advantage of. I don't > > see why that is "unfortunate" at all. How is "Mongolian digit three" > > less of a digit than arabic numeral three? That \d is unicode-aware > > is, IMO, it's strongest selling point over a simple roll-your-own > > character class. \d finds digits; [0-9] finds arabic numerals. > > > > As for what one expects...that's a different story. > snip > > Well, that depends on what you want to do with the data. Generally, I > pull a number out of a string because I want to do math with it, but > Perl only does math with characters "0" .. "9", other characters get > turned into 0. This has made \d next to useless for me as I am > looking for a number and it can return a string. The other problem is > that for years people have been saying "don't use [0-9], use \d > instead", so now we have to say just as loudly and often "Only use \d > if you mean any UNICODE character that is marked as a digit and use > [0-9] when you want to do math on the result" (which is what I am > doing).
Well said, I agree completely. If I ever wanted all Unicode characters that are kinda-...-well-...-numbers-...-at-least-for- someone, I would happily use \p{IsDigit}. Changing the behaviour of \d+ from "a number I can do math with" to "something that when printed someone might know is a number" was ... not a good idea. We can only hope that the use of the non-arabic digits will be very very rare. Jenda ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/