I found the solution, I just created a escape function for Regex characters :
function escapeRegex(string) {
return string.replace(/[-/\^$*+?.()|[]{}]/g, ‘\$&’);
}
and applied it on the string that comes after contains=
so all Regex characters will be escaped so it will be treated like normal string