punch_card_don has asked for the wisdom of the Perl Monks concerning the following question:
I have a series of small text strings. Each contains a statement of a range of values, but in different forms:
1 - 5
3 to 24
6 thru 9
usually from 5 up to 12, but could be as much as 20 or more
I want to extract the numbers from the phrases so I can determine the max and min in the entire set of phrases. Making that determination is no problem, it's hw to extract the numbers.....
I can't always count on there being spaces between the numbers and the other text. A phrase could be mis-typed:
7-8
Thanks
Forget that fear of gravity,
Get a little savagery in your life.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: extract numbers from unformatted text strings
by punch_card_don (Curate) on May 23, 2005 at 16:39 UTC | |
|
Re: extract numbers from unformatted text strings
by Forsaken (Friar) on May 23, 2005 at 16:39 UTC | |
|
Re: extract numbers from unformatted text strings
by TedPride (Priest) on May 23, 2005 at 17:12 UTC | |
by fishbot_v2 (Chaplain) on May 23, 2005 at 17:54 UTC | |
|
Re: extract numbers from unformatted text strings
by sh1tn (Priest) on May 23, 2005 at 16:36 UTC | |
|
Re: extract numbers from unformatted text strings
by davidrw (Prior) on May 23, 2005 at 16:35 UTC | |
|
Re: extract numbers from unformatted text strings
by tlm (Prior) on May 24, 2005 at 03:50 UTC |