in reply to Regex help
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regex help
by bart (Canon) on Aug 24, 2003 at 16:25 UTC |