- or download this
my $len = 0;
my $best = "";
...
}
print "best: $best\n"
- or download this
my $best = "";
while ($string =~ /((.)\2+)/g) {
...
}
print "best: $best\n"
- or download this
my $best = "";
$best = $1 while $string =~ /((.)\2*)(*SKIP)(?(?{length $^N <= length
+$best})(*FAIL))/g;
print "best: $best\n"