Does $a match the regex pattern in $b?
$a =~ /$b/
Does $a contain the string in $b?
$a =~ /\Q$b\E/ $a =~ /\Q$b/ # \E is optional my $b_re = quotemeta($b); # This is what \Q does $a =~ /$b_re/
Does $a equal the string in $b?
$a eq $b $a =~ /^\Q$b\E\z/ my $b_re = quotemeta($b); $a =~ /^$b_re\z/
In reply to Re: special characters in regexp
by ikegami
in thread special characters in regexp
by moked
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |