As you might expect, I was tempted to (ab)use the magical $| flip-flop variable:
but was able to restrain myself. :-)my @words = grep --$|, split /(?<=(.))(?!\1)/, $string;
In reply to Re^3: Split a string based on change of character
by eyepopslikeamosquito
in thread Split a string based on change of character
by eyepopslikeamosquito
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |