Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: combine perl/tk and file::tail::select

by sflitman (Hermit)
on Apr 03, 2011 at 23:38 UTC ( #897255=note: print w/ replies, xml ) Need Help??


in reply to combine perl/tk and file::tail::select

Use the code tags please, your code is not readable. To extract one IP address and port from a string, you can use this regular expression:

my ($ipaddr,$port)=($1,$2) if $string=~/(\d+\.\d+\.\d+\.\d+):(\d+)/;
HTH,
SSF


Comment on Re: combine perl/tk and file::tail::select
Download Code
Replies are listed 'Best First'.
Re^2: combine perl/tk and file::tail::select
by spx2 (Chaplain) on Apr 04, 2011 at 00:34 UTC
    I believe there's a pretty big propaganda against parsing IPs using regexes right here, they recommend NetAddr::IP,Net::IPv6Addr.
    I saw many presentations about IPv6 where one of the slides was with this huge regex for matching IPv6 addresses, so I don't know, maybe this is useful -> Regex::IPv6.
      I believe there's a pretty big propaganda against parsing IPs using regexes right here, they recommend

      Big propaganda? That is an apocalyptic-ally psychotic-ally epic overstatement :)

      See also Socket6/Regexp::Common::net

        I wouldn't say it's psychotic anonymous monk :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (19)
As of 2015-07-29 14:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls