in reply to regex needed
I use this to grab them... cheersmy @ips; while(<DATA>){ chomp; push @ips, map { /\[(\d+\.\d+\.\d+\.\d+)\]/ig } + $_; } print "First IP = $ip[0], Second IP = $ip[1]\n"; print "All IP's Found: @ips"; __DATA__ 1 [111.123.164.80] blah blah [123.126.126.126] 87 000:00:00.0000.000. +000 06/07/2000 04:39:00 PM SNMP: Get 2 [212.123.34.80] 283.120.123 [3.126.126.126] 87 000:00:00.0000.000. +000 06/07/2000 04:39:00 PM SNMP: Get 3 [201.0.164.80] 8.23.1.2.3 [51.126.126.126] 87 000:00:00.0000.000.00 +0 06/07/2000 04:39:00 PM SNMP: Get 4 [111.123.164.80] [12.126.126.126] 87 000:00:00.0000.000.000 06 +/07/2000 04:39:00 PM SNMP: Get
|
|---|