Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Script to input IP Address and Subnet Bits (10.3.2.0/28)

by Joost (Canon)
on Dec 03, 2005 at 15:36 UTC ( #513814=note: print w/replies, xml ) Need Help??


in reply to Script to input IP Address and Subnet Bits (10.3.2.0/28)

You're not matching for the "/XX" part, and the second regex also matches whatever the first matches.

A relatively simple (and too permissive) regex would be:

if ($qs =~ /^[a-zA-Z0-9][a-zA-Z0-9\.\-_]*(\/\d+)?$/) { # do stuff with $qs }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2023-01-30 07:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?