One more for the "it's too late for ES6" train: most other programming
languages have a convenient "safe" way to turn a string into a regular
expression matching that string. `RegExp.escape` is often suggested
as the function name. I think this is worth adding to the standard
library because it helps patch a ["candy machine
interface"](http://www.approxion.com/?p=123) -- that is, I've seen the
following too often (including again today, hence this message):
```js
function replaceTitle(title, str) {
return str.replace(new RegExp(title), "...");
}
```
There ought to be a standard simple way of writing this correctly.
Has this been discussed in the context of ES6/ES7 before?
--scott
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss