RegExp `x` flag

Isiah Meadows isiahmeadows at
Tue Jun 4 03:14:40 UTC 2019

I would personally love this (as well as interpolations in regexp
literals). I do have a concern about whether removing the newline
restriction creates ambiguities with division, but I suspect this is
*not* the case.


Isiah Meadows
contact at

On Mon, Jun 3, 2019 at 10:03 PM Jacob Pratt <jhprattdev at> wrote:
> 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:
> Python:
> Rust:
> XRegExp:
> .NET:
> Jacob Pratt
> _______________________________________________
> es-discuss mailing list
> es-discuss at

More information about the es-discuss mailing list