in reply to Re: Question on REGEXP
in thread Question on REGEXP

So this escapes everything, right? I mean, if you want to treat any given character as normal character, without any exceptions/special meanings.

Replies are listed 'Best First'.
Re^3: Question on REGEXP
by choroba (Cardinal) on Mar 10, 2014 at 14:14 UTC
    Yes. If you only want to escape some characters, you can try the hard way: adding \ in front of them in the string. If you want to escape anything in a substring, you can end the effect of \Q by \E.
    /\Q$literal_characters\E$special_characters/
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      or use quotemeta - see perldoc -f quotemeta
      Aha, thanks for the tips :)