my( $start, $middle, $end ) = split /((?:AB)+)/,$string ;