The \Q and \E are to quote metacharacters (so if $string2 is "f.o", you don't end up matching on "foo").if ($string1 =~ /\Q$string2\E/){...} if (index($string1, $string2) != -1){...}
In reply to Re^2: Finding a variable string within a variable string.
by Eimi Metamorphoumai
in thread Finding a variable string within a variable string.
by Moriarty
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |