RegExp.escape is a static method that takes a string and returns an escaped version that may be used as a pattern inside a regular expression. For example, copied from the proposal explainer: ``` const str = prompt("Please enter a string"); const escaped = RegExp.escape(str); const re = new RegExp(escaped, 'g'); // handles reg exp special tokens with the replacement. console.log(ourLongText.replace(re)); ```
None
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
None
In test262: https://github.com/tc39/test262/tree/main/test/built-ins/RegExp/escape
Shipping on desktop | 135 |
DevTrial on desktop | 135 |
Shipping on Android | 135 |
DevTrial on Android | 135 |
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
--
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 visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/67b91c69.2b0a0220.38f609.020a.GAE%40google.com.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/02ffcec5-69a6-4b44-8275-f3b86b0c9eab%40chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM0wra-7%3DwQ5NqfYKET48uF9Qchu0vKaHKQeB_o-bD3x6JnhPQ%40mail.gmail.com.