in reply to
Re^3: Strip non-numeric
in thread
Strip non-numeric
True, but my point was the pattern of
s/PAT//g
, which would benefit to be written as
s/PAT+//g
.
tr
isn't as flexible - not even in this case.
\D
follow the locale and Unicode rules when appropriate, where as the
tr
has the digits hardcoded.
Abigail
Comment on
Re: Strip non-numeric
Select
or
Download
Code
Replies are listed 'Best First'.
Re^5: Strip non-numeric
by
Aristotle
(Chancellor)
on Jan 14, 2003 at 10:19 UTC
Ah, I didn't think of Unicode. I briefly considered the locale awareness, but couldn't think of any case where that would change the meaning of
\d
.
Makeshifts last the longest.
[reply]
Re: Strip non-numeric
by
Abigail-II
(Bishop)
on Jan 14, 2003 at 10:25 UTC
There could be a locale that considers ¼, ½ and ¾ to be numeric.
Abigail
[reply]
In Section
Seekers of Perl Wisdom