in reply to precompiling regular expressions
$string2 = qr/$string2/; $string1 =~ $string2; [download]