my @matches;
while ($input->{string} =~ /$regex/g) {
+ my $offset = $-[1];
+ die "Match group required in regex '$regex'" if not defined $offset;
+
my ($x, $y) = input_match_offset_to_coordinates($input->{width},
- $-[0]);
+ $offset);
push @matches, { x => $x, y => $y, string => $1 };
}
return @matches;