You're close enough already that I wonder if I'm misunderstanding the question.
use strict; use warnings; use Data::Dumper; my $string_containing_needed_matches = 'XXXreYYY' x 3; my @arr = $string_containing_needed_matches =~ /XXX(re)YYY/g; print Dumper \@arr; __END__ $VAR1 = [ 're', 're', 're' ];
In reply to Re: collecting array from pattern parenthesis
by kyle
in thread collecting array from pattern parenthesis
by vit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |