... while(/\*\*\*\() \*\*/g) { my $iface = $1; if(/\G ip adress (\d+\.\d+\.\d+\.\d+/){print "iface $iface is definde with $1"} } ...