in reply to collecting array from pattern parenthesis
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' ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: collecting array from pattern parenthesis
by vit (Friar) on Sep 26, 2008 at 16:52 UTC | |
by moritz (Cardinal) on Sep 26, 2008 at 17:04 UTC | |
by vit (Friar) on Sep 26, 2008 at 18:12 UTC |