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

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.

      There could be a locale that considers ¼, ½ and ¾ to be numeric.

      Abigail