in reply to Regex backreference problem.
$_ = 'aaabbbbbbbbbbbbbccccccccccccccccccccc'; print "$1|$2\n" while (m[(.)(?>\1+)(.)]g); [download]