in reply to Re^2: Extraction number from Text
in thread Extraction number from Text
Great point with respect to the '*' quantifier for the character class.
The OP's example, which uses the '*' quantifier would, of course, allow NAN's to be parsed as numbers. For example: "--eeeeeeeeeee1" would be accepted as a number when it's definitely not (although perl could evaluate that string in numeric context giving it a value of 1). I didn't attempt to address that issue, but it goes to punctuate your next point which is.....
Regex::Common is a nice resource too. If there's a resource that knows how to parse numbers, why write ones own number parser when it (a) takes more time, and (b) possibly introduces bugs? Regex::Common is the answer to both 'a' and 'b'.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Extraction number from Text
by JavaFan (Canon) on Jun 14, 2010 at 10:08 UTC | |
|
Re^4: Extraction number from Text
by proceng (Scribe) on Jun 14, 2010 at 13:51 UTC |