in reply to Re: Number?
in thread Number?
<pedantic type=unicode>
Not so fast! Believe it or not, \d matches 178 characters in utf8. [1]
So, while your second two solutions are equivalent, the first one is only correct if you know you're dealing with ASCII.
[1]: Just in case you don't believe me :-)
[~] $ perl -anle'next if/[^\s\da-f]/i;$t+=hex($F[1])-hex($F[0]); END{print$t}' bleadperl/lib/unicode/Is/Digit.pl 178
</pedantic>
-dlc
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: (dchetlin: beware the unicode beast) Re(2): Number?
by Fastolfe (Vicar) on Oct 25, 2000 at 19:13 UTC | |
by dchetlin (Friar) on Oct 25, 2000 at 19:45 UTC |
In Section
Seekers of Perl Wisdom