Another way to do this would be with split.
my( $start, $middle, $end ) = split /((?:AB)+)/,$string ;
Much of a muchness in this case, but it does show the little used technique of using capturing brackets with split to retain the bits that would otherwise be discard, which is sometimes useful.
In reply to Re: Regex help
by BrowserUk
in thread Regex help
by gri6507
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |