I hate when that happens.
I have searched for hours for the answer.
Finally after posting I find it.
----------------------------------------------------------
These are the characters that are given special meaning within a regular expression, which you will need to backslash if you want to use literally:. * ? + [ ] ( ) { } ^ $ | \ Any other characters automatically assume their literal meanings.
You can also turn off the special meanings using the escape sequence \Q . After perl sees \Q , the 14 special characters above will automatically assume their ordinary, literal meanings. This remains the case until perl sees either \E or the end of the pattern.
For instance, if we wanted to adapt our matchtest program just to look for literal strings, instead of regular expressions, we could change it to look like this:
if (/\Q$pattern\E/) {
Now the meaning of + is turned off: