Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Regex to catch IPV4 and IPV6 whenever ip appears withing brackets

by theravadamonk (Scribe)
on Jul 10, 2018 at 05:39 UTC ( [id://1218216]=note: print w/replies, xml ) Need Help??


in reply to Re: Regex to catch IPV4 and IPV6 whenever ip appears withing brackets
in thread Regex to catch IPV4 and IPV6 whenever ip appears withing brackets

Thanks for your reply.

IPV6 have characters as well. see below stuffs

2404:6800:4003:c04::5e

2600:3c00::f03c:91ff:fedf:f016

So, In YOUR below code, \d can be replaced with \w

 my @ips = m/\(([\w\.:]+)[\s<>]*([\w\.:]+)?[\s<>]*([\w\.:]+)?\)/;

\w Matches any letter, digit or underscore. Equivalent to a-zA-Z0-9_

it's greedy isn't it ? anyway, Thanks for your effort.

  • Comment on Re^2: Regex to catch IPV4 and IPV6 whenever ip appears withing brackets
  • Download Code

Log In?
Username:
Password:

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

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

    No recent polls found