I want to create a regular expression that exactly matches the string foo, even if foo contains metacharacters. This is sometimes called RegExp.quote
. Is there a way to do this in Node.js (or, more broadly, v8 / Chrome / WebKit / JavaScript)?
source share