Well see here is the quandry. You have interpreted it one way and I have another. Peamasii didn't define what exactly s/he meant by number. It could mean a single digit as I used, it could mean an integer which you described (which will match 0004 and miss -4 btw), or it could mean any number (pun intended) of things. For instance:
It is probably as common a mistake to assume what you are thinking is universally understood when asking questions as it is for the person that is answering to assume they know what you mean. I think we both fall into the latter category this time.use Scalar::Util 'looks_like_number'; if ( looks_like_number( $foo ) && $foo =~ /^\??$/ ) {...}
Cheers - L~R
In reply to Re^3: need help with a Regex
by Limbic~Region
in thread need help with a Regex
by Peamasii
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |