in reply to extract numbers from unformatted text strings
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.
|
|---|