Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Intent to Ship: RegExp.escape

165 views
Skip to first unread message

Chromestatus

unread,
Feb 21, 2025, 8:24:02 PMFeb 21
to blin...@chromium.org, s...@chromium.org

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 (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).

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.

Mike Taylor

unread,
Feb 24, 2025, 9:52:25 AMFeb 24
to Chromestatus, blin...@chromium.org, s...@chromium.org

LGTM1

--
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.

Domenic Denicola

unread,
Feb 25, 2025, 12:22:23 AMFeb 25
to Mike Taylor, Chromestatus, blin...@chromium.org, s...@chromium.org

TAMURA, Kent

unread,
Feb 25, 2025, 1:57:40 AMFeb 25
to s...@chromium.org, Chromestatus, blin...@chromium.org

Woody

unread,
Mar 27, 2025, 10:54:24 PMMar 27
to blink-dev, tk...@chromium.org, Chromestatus, blin...@chromium.org, s...@chromium.org
It seems like shipped in 136; should we update the milestone if so?
https://chromiumdash.appspot.com/commit/bb205a92ead761e2532c07f87c3c0f9223f69112

Reply all
Reply to author
Forward
0 new messages