in reply to Regexp question,get 2nd match

Assuming the IP address will always have a port number appended to it:

use Regexp::Common qw( net ); while ( <DATA> ) { while ( m/($RE{net}{ipv4}:\d+)/g ) { print $1, "\n"; } } __DATA__ [LAN access from remote] from 213.114.117.222:52582 to 10.0.0.3:5697, +Monday, July 23,2012 19:42:26

If you're only interested in those IP's that access "10.0.0.x:y", this will do it:

while( m/(10\.0\.0\.\d+:\d+)/ ) { print $1, "\n"; }

If you want something else then let's back up and discuss what you're trying to accomplish first.


Dave