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


in reply to Elegant way to split into sequences of identical chars?

I don't have a perl to test with right now, but I think this will work:
$repeater = qr/(.)\1+/; @matches = $string =~ /((??{$repeater}))/g;