Welcome to the Monastery | |
PerlMonks |
Re^2: Regex to catch IPV4 and IPV6 whenever ip appears withing bracketsby theravadamonk (Scribe) |
on Jul 10, 2018 at 05:39 UTC ( [id://1218216]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|