##
my $best = "";
while ($string =~ /((.)\2+)/g) {
$best = $1 if length $1 > length $best
}
print "best: $best\n"
##
##
my $best = "";
$best = $1 while $string =~ /((.)\2*)(*SKIP)(?(?{length $^N <= length $best})(*FAIL))/g;
print "best: $best\n"