Help for this page

Select Code to Download


  1. or download this
    $ perl -e '$_="aaabbccccddeee"; print $1,$/ while /((.)\2*)/g'
    #                                                  ^^
    ...
    cccc
    dd
    eee
    
  2. or download this
     push @array, $1 while  /((.)\2*)/g;
    
  3. or download this
    # THIS IS WRONG
    @array = $_ =~ /((.)\2*)/g;
    print join ", " , map {"<$_>"} @array;
    __END__
    <aaa>, <a>, <bb>, <b>, <cccc>, <c>, <dd>, <d>, <eee>, <e>