http://www.perlmonks.org?node_id=529547


in reply to just another search program

Another way to grab all other ip addresses (preceding the "Monitored ..." line) is with the pattern match like this one:
$/=undef; $d=<DATA>; my (@ip)=($d=~m/number addresses(?:.*?)((?:\d{1,3}\.){3}\d{1,3})/gsi); print "Other addresses: ". join("\n",@ip)."\n"; __DATA__ Network name A Interface WEB_A ggggggggg VRID 145 State: Master XXXXXXXXXXXX Effective Priority: 200 07:09:56:04:0t:ef Primary address: 194.551.205.250 Number addresses: 1 135.51.045.242 Monitored circuits: vbgghdfgdfg Interface WEB_B ggggggggg Agggggg VRID 145 State: backup XXXXXXXXXXXX Effective Priority: 200 07:09:56:04:0t:ef Primary address: 19.51.205.20 Next advertisement: 0 Number addresses: 1 135.51.05.22 Monitored circuits: vbgghdfgdfg


_____________________
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce
the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true."

Robert Wilensky, University of California