while (m/($regex)/g and my $match = $1) { print qq{captured '$match'}; }