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: https://www.regular-expressions.info/freespacing.html

Language references:
Python: https://docs.python.org/3/library/re.html#re.X
Rust: https://docs.rs/regex/1.1.6/regex/
XRegExp: http://xregexp.com/xregexp/flags/#extended
.NET:
https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference#regular-expression-options

Jacob Pratt
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to