A TC39 proposal to add extended mode (x flag) with insignificant whitespace and comments to ECMAScript regular expressions.
This proposal introduces an extended mode (x flag) for ECMAScript regular expressions, enabling developers to write more readable and maintainable patterns. It allows insignificant whitespace and supports both inline and line comments, aligning JavaScript with features common in other regex engines.
x flag) — Treats unescaped whitespace as insignificant, enabling multi-line regex patterns.(?#comment) syntax to embed documentation directly within patterns.# comment syntax for end-of-line explanations when using the x flag.The proposal aims to enhance developer experience by adopting proven regex features from other languages, making complex patterns easier to write, read, and maintain without breaking existing functionality.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.