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.
In reply to Re: Regex negative number question
by dragonchild
in thread Regex negative number question
by Lori713
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |