http://www.perlmonks.org?node_id=629262


in reply to Split a string based on change of character

my $str= "AAABBCCCC"; my @x; push @x, $1 while $str =~ /((.)\2*)/g;

- tye