Contact emails
s...@chromium.org

Explainer
None


Specification
https://tc39.es/proposal-regex-escaping


Summary

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)); ```



Blink component
Blink>JavaScript>Language


TAG review
None


TAG review status
Not applicable


Risks




Interoperability and Compatibility

None


Gecko: Shipped/Shipping 
(https://groups.google.com/a/mozilla.org/g/dev-platform/c/yWsLDyVI044/m/qLsdrApJCQAJ)

WebKit: Shipped/Shipping 
(https://developer.apple.com/documentation/safari-release-notes/safari-18_2-release-notes#JavaScript)

Web developers: No signals

Other signals:


WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it 
has potentially high risk for Android WebView-based applications?

None




Debuggability

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, 
ChromeOS, Android, and Android WebView)?
Yes


Is this feature fully tested by web-platform-tests?
Yes
In test262: 
https://github.com/tc39/test262/tree/main/test/built-ins/RegExp/escape



Flag name on about://flags
--js-regexp-escape


Finch feature name
V8Flag_js_regexp_escape


Requires code in //chrome?
False


Estimated milestones


Shipping on desktop 135

DevTrial on desktop 135

Shipping on Android 135

DevTrial on Android 135




Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop 
issues. Please list open issues (eg links to known github issues in the project 
for the feature specification) whose resolution may introduce web 
compat/interop risk (eg, changing to naming or structure of the API in a 
non-backward-compatible way).
None


Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5179154657705984?gate=5169829075746816


This intent message was generated by Chrome Platform Status.

-- 
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+unsubscr...@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.

Reply via email to