RegExp.escape

Alexander Jones alex at weej.com
Fri Jun 12 18:34:30 UTC 2015


At risk of bikeshed, I think I would prefer syntax for it, personally, e.g.:

    let myRegExp = /\d+\./{arbitrary.js(expression)}/SOMETHING$/;

(ASI issues notwithstanding) vaguely matching the idea of template strings.
I prefer this kind of thing to be structured at the parse-level rather than
relying on runtime string stitching and hoping for a valid parse.

Cheers

On Friday, June 12, 2015, Benjamin Gruenaum <benjamingr at gmail.com> wrote:

> Reviving this, a year passed and I think we still want this.
>
> We have even more validation than we had a year ago (added by libraries
> like lodash) and this is still useful.
>
> What would be the required steps in order to push this forward to the
> ES2016 spec?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150612/e8b13317/attachment.html>


More information about the es-discuss mailing list