RegExp `x` flag

Jacob Pratt jhprattdev at
Tue Jun 4 02:02:53 UTC 2019

Has there been any previous discussion of adding the `x` flag to JS? It
exists in other languages, and can make relatively complicated regex _much_
easier to read. It also allows for comments, which are incredibly helpful
when trying to understand some regexes.

For prior art, XRegExp has this flag (though I've no idea to figure out how
frequently it's used), as do a few other languages.

Quick overview:

Language references:

Jacob Pratt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list