$x = "A\\B"; $y = "Here is A\\B"; print $y =~ /$x/ ? "y" : "n"; $x = "\\B"; $y = "Here is \\B"; print $y =~ /$x/ ? "y" : "n";Prints: ny although only the 'A' is different. What is so special about the backslash, that it knows about what is in front.
In reply to Strange backslash in regexp behaviour by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |