in reply to Regex matchin -(lala)- problem
$file ="-(lala)-"; $skip ="-(lala)-"; print "$skip / $file\n"; if ($file =~ /\Q$skip\E/i) { print "matched!\n"; }
See quotemeta. You could also use \ if your pattern is static, just watch out for the double quotes eating it up:
$skip = "-\(lala\)-"; # $skip is now -(lala)- compared with $skip = '-\(lala\)-'; # $skip is now -\(lala\)-
-- Dan
|
|---|