Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Stupid regex question - numerics

by ungalnanban (Pilgrim)
on Mar 01, 2010 at 11:58 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://825884]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-03-19 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found