in reply to regex in perl
use Regexp::Common qw /net/; ...; my @temp = grep {$RE{net}{IPv6}{-sep=>':'}{-style=>'HeX'}} @$records; my @ip = grep {!/^[a-f0-9]{4}\:[a-f0-9]{4}\:ffff/i} @temp;
UPDATE:
The original syntax is correct, but AnomalousMonks' suggestion is probably clearer.
Soonix's requirement can be met by specifying a regex for sep. It probably will not extract the ipv4 address correctly, but that is not a requirement in this case.
{-sep=>qr/[:.]/}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex in perl
by AnomalousMonk (Archbishop) on Jun 15, 2016 at 06:47 UTC | |
|
Re^2: regex in perl
by AnomalousMonk (Archbishop) on Jun 16, 2016 at 04:37 UTC | |
by BillKSmith (Monsignor) on Jun 16, 2016 at 16:04 UTC | |
|
Re^2: regex in perl
by soonix (Chancellor) on Jun 15, 2016 at 09:21 UTC |