A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

RegExp.escape(str)

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).

jonathantneal
2015-06-10

I have put together a prollyfill for this: https://github.com/jonathantneal/regexp-escape

stuartpb
2015-07-08

Apparently this was proposed in es-discuss 5 years ago with some new discussion taking place now: https://esdiscuss.org/topic/regexp-escape

stuartpb
2015-07-31

Ugh.