in reply to Re: Regex Subexpressions
in thread Regex Subexpressions

To produce the output which BenjiSmith is looking for, I would make one modification, s/push/unshift/:
#!/usr/bin/perl -w use strict; use warnings; my $test = 'abc'; my @matches; $test =~ /(a(bc?)?)(??{unshift @matches, $^N})(?!)/; print "@matches\n";
Here's another "solution", which may not be at all correct (it matches an input string of "aaa", for example), but does it shed any more light on what the solution should be?:
#!/usr/bin/perl -w use strict; use warnings; my $test = "abc"; my $count = 1; while ($test =~ m/([abc]{$count})/) { my $match = $1; ++$count; printf "%s\n", $match; }