Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: Re: resolving ip's to names in a text file

by lshatzer (Friar)
on Jul 20, 2001 at 04:09 UTC ( [id://98288]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: resolving ip's to names in a text file
in thread resolving ip's to names in a text file

Taking the regex out of RE: Matching an IP address, which is from the MRE book, with a few small modifications, came up with this.
my @ips = ($string =~ 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]))/g);
Now @ips will have an array full of IP's, if they are valid or not is another discussion...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-03-30 08:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found