in reply to Re: Regex substitute matches second match first?
in thread Regex substitute matches second match first?

Hi Hauke D

Thanks for the reply

OK, the code:

use Regexp::Common qw/net/; if ($line =~ /Relay access denied/) { my @ips = $line=~/$RE{net}{IPv4}/g; print "$_\n" for @ips; }

looks good, but the example I used is not the only scenerio - I capture several matches all covered but one regex - and other lines contain certain IP's that I am not interested in - postfix always puts the maverick ip in [] brackets.

Thanks for your help - I will look at this further anyway.

Nick>