in reply to Regex negative number question
if ($line =~ /-\d*\.\d*/o) becomes if ($line =~ /-\d*\.\d*/o && $line =~ /\d/o)
That said, check out Regexp::Common - it has a ton of regexes that are a lot more complicated than most people will ever understand, but are extremely useful. Such as, recognizing a number that's in pretty much any format (including scientific).
And, congratz on the Perl class. You've been wanting that for a while. I'm glad you enjoyed yourself. Next step - answering questions on PM! :-)
------
We are the carpenters and bricklayers of the Information Age.
The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regex negative number question
by CombatSquirrel (Hermit) on Oct 06, 2003 at 15:05 UTC | |
by Abigail-II (Bishop) on Oct 06, 2003 at 22:14 UTC | |
|
Re: Re: Regex negative number question
by zby (Vicar) on Oct 06, 2003 at 15:12 UTC |