RegExp modifiers adds the ability to locally modify the 'i', 'm', and 's' flags inside a pattern. To enable a flag for a subexpression, use `(?X:subexpr)` where X is one of 'i', 'm', or 's'. To disable a flag for a subexpression, use `(-X:subexpr)`. For example, for the case-insensitivity 'i' flag: ``` const re1 = /^[a-z](?-i:[a-z])$/i; re1.test("ab"); // true re1.test("Ab"); // true re1.test("aB"); // false const re2 = /^(?i:[a-z])[a-z]$/; re2.test("ab"); // true re2.test("Ab"); // true re2.test("aB"); // false ```
No interoperability risk. This is a Stage 3 TC39 proposal.
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
No special needs. JS RegExps already debuggable.
In test262: https://github.com/tc39/test262/pull/3960
DevTrial on desktop | 122 |
DevTrial on Android | 122 |
Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).
NoneLGTM1 - looks like a useful addition already supported in a
number of other RegExp engines.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAN-e9e948%3DQSg6zskRN25JGkvxXVP67RDkXHvijzBRueP1DnzA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/719d4913-1462-479c-b2e4-7ad6cd36c539%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM0wra8qfsTjt%2Bw62YBzV74FN4SKLOLqjrVky52Jzp03wyfjQA%40mail.gmail.com.