Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Regexp to match IP address

by dsb (Chaplain)
on Aug 06, 2004 at 14:31 UTC ( [id://380565]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    m/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\$/;
    
  2. or download this
    use strict;
    my @nums;
    ...
    
    # test each for <= 255 here.
    # also make sure its not 0.0.0.0
    
  3. or download this
    m/^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.
       ([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])$/;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-03-29 14:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found