stuartpb
2015-04-25
Simply put, it would be nice if the function to escape string literals for use within a regular expression were a polyfillable standard (as described at http://stackoverflow.com/a/3561711/34799).
Simply put, it would be nice if the function to escape string literals for use within a regular expression were a polyfillable standard (as described at http://stackoverflow.com/a/3561711/34799).
I have put together a prollyfill for this: https://github.com/jonathantneal/regexp-escape
Apparently this was proposed in es-discuss 5 years ago with some new discussion taking place now: https://esdiscuss.org/topic/regexp-escape
Ugh.