Escape Regular Expression Characters in String


/ Published in: JavaScript
Save to your folder(s)

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.