Anytime you want to use a literal string for comparison inside a regular expression, just use quotemeta
on it.
There are also some helpful escape codes to shortcut that process, \Q
... \E
, which can be included inside a double quoted string or regex LHS to escape special characters.