I am trying to extract information from a text file and am having problems extracting the matches.
The sample file is: -
zone: zone_name
50:06:0e:80:04:58:1d:04
10:00:00:00:c9:6a:11:02
and the regular expression is: -
( $file =~ /zone:\s+(\w*)(?:\n\s*((?:[a-f\d]{2}{7}[a-f\d]{2})){2}/ )
This matches but gives me a list of two items, the first match and the last, but it should be giving me three since the second part of the expression is matching exactly twice.
I assume that somewhere along the line the middle match is being clobbered, but I don't know how to stop this.
Thanks for any assistance.
Warren
The sample file is: -
zone: zone_name
50:06:0e:80:04:58:1d:04
10:00:00:00:c9:6a:11:02
and the regular expression is: -
( $file =~ /zone:\s+(\w*)(?:\n\s*((?:[a-f\d]{2}{7}[a-f\d]{2})){2}/ )
This matches but gives me a list of two items, the first match and the last, but it should be giving me three since the second part of the expression is matching exactly twice.
I assume that somewhere along the line the middle match is being clobbered, but I don't know how to stop this.
Thanks for any assistance.
Warren