my @x = "xx556xx" =~ m/((.)\2*)/g; @x = map { $x[2*$_] } (0..@x/2-1);