Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    $str = q{aabbbbcddddddee};
    $str =~ s/((.)\2{2})\2+/$1/g;
    print qq{Corrected regex\n  $str\n};
    
  2. or download this
    Starting string
      aabbbbcddddddee
    ...
      aabbbbcddddddee
    Corrected regex
      aabbbcdddee