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.


Comment on Re: Stupid regex question - numerics
Download Code

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 scrutinizing the Monastery: (8)
As of 2014-10-21 07:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (98 votes), past polls