This is a bug of Perl's regular expression.
What will "(a)|(b)\1|(b)\2" match in "bb"?
The perl script below shows that "(a)|(b)\1|(b)\2" matches the empty string
"" before "bb", which can't be correct.
do {
print "Enter a regular expression: ";
$re = ;
chop($re);
do {
print "Enter a string: ";
$_ = ;
chop($_);
if (m/$re/) {
print "$re matches \"$&\" in $_\n"; # the matched part.
print "\$` = $`\n"; # the part of the string before the match.
print "\$'