Help for this page
$s = 'xxaabcdabcabcecdecdxx'; ... x 4 xx 2
while($s=~/(\w\w+)(?=.*?\1)/g) { ... } pos($s) = pos($s) +1 -length $1; # fix }