in reply to Regexp::Common balanced brackets non-capture multiple occurances
For exampl, with #2 & #6 that gives:my $didit=/^ a # literal a \s* # optional whitespace ((?: $re \s* )+) (.*) # something 42 # literal 42 $/x; print Dumper [$_, $didit?($1,$2):(undef,undef), $didit];
The issue is with the "something" .* -- it just sucks up anything bad.# 2 $VAR1 = [ 'a [foo] [bar]bla[quux] grmbl42', '[foo] [bar]', 'bla[quux] grmbl', '1' ]; # 6 $VAR1 = [ 'a [fo]o] grmbl42', '[fo]', 'o] grmbl', '1' ];
|
|---|