in reply to Re^2: need help with a Regex
in thread need help with a Regex
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: need help with a Regex
by Dietz (Curate) on Oct 06, 2004 at 15:58 UTC | |
by Limbic~Region (Chancellor) on Oct 06, 2004 at 16:42 UTC | |
by Dietz (Curate) on Oct 06, 2004 at 16:56 UTC | |
Re^4: need help with a Regex
by TedPride (Priest) on Oct 07, 2004 at 09:10 UTC | |
by Limbic~Region (Chancellor) on Oct 07, 2004 at 12:16 UTC |