in reply to Remove all non-numeric characters except for an optional negative sign (-)

choroba and pme answered your question. For the future, this is documented in Matching repetitions from perlretut and Quantifiers from perlre.

Are you sure you'll never care about cases like +5, 1.2, and 1E10?


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

  • Comment on Re: Remove all non-numeric characters except for an optional negative sign (-)