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

Forgot to post my solution early, but its similar to yours so i'll add it here.

use Data::Dumper; my $test = "xx556xxyyy"; my @matches ; push @matches, $1 while ($test =~ /((.)\2*)/g); print Dumper(@matches);

These solutions have the added benefit of being able to switch to just a list of chars by changeins $1 to $2. Not sure thats of any use but hey. lol. I'm mildly suprised there is no regex command to match last char, or a way to specify which groups to return and with are just used internal to the regex, I guess the need doesn't arise that often.


___________
Eric Hodges $_='y==QAe=e?y==QG@>@?iy==QVq?f?=a@iG?=QQ=Q?9'; s/(.)/ord($1)-50/eigs;tr/6123457/- \/|\\\_\n/;print;