Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 chanting in the Monastery: (3)
As of 2016-09-25 06:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (464 votes). Check out past polls.