/ Published in: JavaScript
Escape all special regex characters (.*+?|()[]{}\) from a string. Useful when dynamically building a Regular Expression object based on input text that could hold regex characters.
URL: http://stackoverflow.com/questions/280793/case-insensitive-string-replacement-in-javascript