in reply to stripping everything but numbers and letters

Note that adding a + inside will also strip out +, is that intentional as a sign? If so, what about . (decimal point) and - (minus)?

The are various character classes, and shortcuts like \s (whitespace) and \d (decimal). Of the POSIX character classes [:alnum:] might be most relevant.

To improve it you can always consider comments ;-)
  • Comment on Re: stripping everything but numbers and letters

Replies are listed 'Best First'.
Re^2: stripping everything but numbers and letters
by Anonymous Monk on Feb 06, 2009 at 11:40 UTC
    \d is digit, not number or decimal, but digit, 0-9.