Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by sflitman (Hermit)
on Apr 03, 2011 at 23:38 UTC ( [id://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

Replies are listed 'Best First'.
Re^2: combine perl/tk and file::tail::select
by spx2 (Deacon) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://897255]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-18 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found