Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Stupid regex question - numerics

by ungalnanban (Pilgrim)
on Mar 01, 2010 at 11:58 UTC ( #825884=note: print w/ replies, xml ) Need Help??


in reply to Stupid regex question - numerics

Hi.. your negating the matched patten that is the problem. see the Example.
my $long =-4.332423424; my $lat = 0; if ( ($long > 180 || $long < -180) || ($lat > 90 || $lat < -90) || $long =~ /^([\d\-\.]+)$/ || $lat =~ /^([\d\-\.]+)$/ ) { print "welcome\n"; }

Now it matched the condition correctly.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://825884]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2016-06-27 14:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (337 votes). Check out past polls.