| Next | Regular Expression Mastery | 76 | 
Our trick:
        split /(a+)/, $string
This breaks $string into pieces which alternate between
Strings of a's
The other stuff that was between the a's
Note special split meaning of (capturing parentheses).
| Next | ![]()  | 
    Copyright © 2002 M. J. Dominus |