in reply to Re: Regex help
in thread Regex help

No, you really should have done this:
my($start, $middle, $end) = split /((?:AB)+)/, $string, 2;
Try something that contains this pattern twice, and you'll immediately see the difference, as in
$string = "xAByABz";
Yours would have put just "y" into $end, mine takes the entire rest of the string, "yABz".