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

Re: Clueless newbie - help!

by dsb (Chaplain)
on May 08, 2002 at 21:23 UTC ( [id://165188]=note: print w/replies, xml ) Need Help??


in reply to Regular expression range question (was: Clueless newbie - help!)

Um, if I'm clear, you need to know how to match a number from 1-126 or from 17-31:
# tests for a 3 digit number from 1 - 126 $num =~ m/^(1(?:[01]\d|2[0-6])|\d?\d)$/; # tests for a 2 digit number from 17 - 31 $num =~ m/^(1[7-9]|2\d|3[01])$/;
This is a bit messy so you may want to investigate methods by which you can check IP's that don't use a regex. Perhaps one of the Net modules.




Amel
This is my cool %SIG

Log In?
Username:
Password:

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

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

    No recent polls found