The first can match the start between AAA and the first CCC.
Then you loop over the remaining and push the join with the last match into an array.
Maybe easier to maintain than a complicated regex.
See also
perlretut#Using-regular-expressions-in-Perl
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
In reply to Re: regex (between two words)
by LanX
in thread regex (between two words)
by nickwest
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |