There's more than one way to do things | |
PerlMonks |
Re: regex (between two words)by LanX (Saint) |
on Feb 09, 2020 at 19:37 UTC ( [id://11112696]=note: print w/replies, xml ) | Need Help?? |
You can use 2 regexes with the /c modifier to keep the position. 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.
UpdateSee also perlretut#Using-regular-expressions-in-Perl
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|