in reply to extract numbers from unformatted text strings

Update: more careful reading yielded that you *can't* count on there being spaces so solution one goes down the trash...

Bad solution...ignore assuming for the moment that there will always be spaces after the first and before the next number, and that *no other* numericals will be in the string, you could match against /(\d+)\s.*\s(\d+)/ which will put the 2 numbers in $1 and $2 respectively.

Or another alternative would be to simply match for /(d\+)/g which will extract all numbers from the string. It all depend on what they look like exactly and what kind of pits you have to avoid.


Remember rule one...