I need to replace this string literally: /:)
However, if I do it like this
test = text.replace(//:\)/gi, replacement);
Javascript will treat //
as the beginning of a comment. If I do it like this (add brackets):
test = text.replace(/(/:\))/gi, replacement);
this is a syntax error, since it will treat /(/
as the pattern
What can I do get around this?