Help for this page

Select Code to Download


  1. or download this
    my $str = 'xx556xx';
    my @x = grep --$|, $str =~ m/((.)\2*)/g;
    print join ',', @x;
    
  2. or download this
    my $str = 'xx556xx';
    my $tog = 0;
    my @x = grep $tog = !$tog, $str =~ m/((.)\2*)/g;
    print join ',', @x;
    
  3. or download this
    my $str = 'xx556xx';
    my $tog = 0;
    my @x = grep $tog = !$tog, split /(?<=(.))(?!\1)/, $str;
    print join ',', @x;