@@ -148,6 +148,7 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
148
148
- [ ` String.prototype.trimStart ` / ` String.prototype.trimEnd ` ] ( #stringprototypetrimstart-stringprototypetrimend )
149
149
- [ ` RegExp ` ` s ` (` dotAll ` ) flag] ( #regexp-s-dotall-flag )
150
150
- [ ` RegExp ` named capture groups] ( #regexp-named-capture-groups )
151
+ - [ ` RegExp ` escaping] ( #regexp-escaping )
151
152
- [ ` Promise.allSettled ` ] ( #promiseallsettled )
152
153
- [ ` Promise.any ` ] ( #promiseany )
153
154
- [ ` Promise.prototype.finally ` ] ( #promiseprototypefinally )
@@ -164,7 +165,6 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
164
165
- [ ` Float16 ` methods] ( #float16-methods )
165
166
- [ ` Uint8Array ` to / from base64 and hex] ( #uint8array-to--from-base64-and-hex )
166
167
- [ Explicit resource management] ( #explicit-resource-management )
167
- - [ ` RegExp ` escaping] ( #regexp-escaping )
168
168
- [ ` Math.sumPrecise ` ] ( #mathsumprecise )
169
169
- [ ` Symbol.metadata ` for decorators metadata proposal] ( #symbolmetadata-for-decorators-metadata-proposal )
170
170
- [ ` Error.isError ` ] ( #erroriserror )
@@ -893,7 +893,7 @@ Adding support of well-known [symbols](#ecmascript-symbol) `@@match`, `@@replace
893
893
894
894
Annex B methods. Modules [`es.string.anchor`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.string.anchor.js), [`es.string.big`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.string.big.js), [`es.string.blink`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.string.blink.js), [`es.string.bold`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.string.bold.js), [`es.string.fixed`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.string.fixed.js), [`es.string.fontcolor`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.string.fontcolor.js), [`es.string.fontsize`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.string.fontsize.js), [`es.string.italics`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.string.italics.js), [`es.string.link`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.string.link.js), [`es.string.small`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.string.small.js), [`es.string.strike`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.string.strike.js), [`es.string.sub`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.string.sub.js), [`es.string.sup`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.string.sup.js), [`es.string.substr`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.string.substr.js), [`es.escape`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.escape.js) and [`es.unescape`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.unescape.js).
895
895
896
- ` RegExp ` features: modules [ ` es.regexp.constructor ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.regexp.constructor.js ) , [ ` es.regexp.dot-all ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.regexp.dot-all.js ) , [ ` es.regexp.flags ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.regexp.flags.js ) , [ ` es.regexp.sticky ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.regexp.sticky.js ) and [ ` es.regexp.test ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.regexp.test.js ) .
896
+ ` RegExp ` features: modules [ ` es.regexp.constructor ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.regexp.constructor.js ) , [ ` es.regexp.escape ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.regexp.escape.js ) , [ ` es.regexp. dot-all` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.regexp.dot-all.js ) , [ ` es.regexp.flags ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.regexp.flags.js ) , [ ` es.regexp.sticky ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.regexp.sticky.js ) and [ ` es.regexp.test ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.regexp.test.js ) .
897
897
``` ts
898
898
class String {
899
899
static fromCodePoint(... codePoints : Array <number >): string ;
@@ -939,6 +939,7 @@ class String {
939
939
class RegExp {
940
940
// support of sticky (`y`) flag, dotAll (`s`) flag, named capture groups, can alter flags
941
941
constructor (pattern : RegExp | string , flags ? : string ): RegExp ;
942
+ static escape(value : string ): string
942
943
exec(): Array <string | undefined > | null ; // IE8 fixes
943
944
test(string : string ): boolean ; // delegation to `.exec`
944
945
toString(): string ; // ES2015+ fix - generic
@@ -998,6 +999,7 @@ core-js(-pure)/es|stable|actual|full/string(/virtual)/sup
998
999
core-js(-pure)/es|stable|actual|full/string(/virtual)/iterator
999
1000
core-js/es|stable|actual|full/regexp
1000
1001
core-js/es|stable|actual|full/regexp/constructor
1002
+ core-js(-pure)/es|stable|actual|full/regexp/escape
1001
1003
core-js/es|stable|actual|full/regexp/dot-all
1002
1004
core-js(-pure)/es|stable|actual|full/regexp/flags
1003
1005
core-js/es|stable|actual|full/regexp/sticky
@@ -1086,6 +1088,20 @@ for (let { groups: { number, letter } } of '1111a2b3cccc'.matchAll(RegExp('(?<nu
1086
1088
' a💩b' .toWellFormed (); // => 'a💩b'
1087
1089
' a\uD83D b' .toWellFormed (); // => 'a�b'
1088
1090
```
1091
+
1092
+ [ * Example* ] ( https://tinyurl.com/ykac4qgy ) :
1093
+ ``` js
1094
+ console .log (RegExp .escape (' 10$' )); // => '\\x310\\$'
1095
+ console .log (RegExp .escape (' abcdefg_123456' )); // => '\\x61bcdefg_123456'
1096
+ console .log (RegExp .escape (' Привет' )); // => 'Привет'
1097
+ console .log (RegExp .escape (' (){}[]|,.?*+-^$=<>\\ /#&!%:;@~\' "`' ));
1098
+ // => '\\(\\)\\{\\}\\[\\]\\|\\x2c\\.\\?\\*\\+\\x2d\\^\\$\\x3d\\x3c\\x3e\\\\\\/\\x23\\x26\\x21\\x25\\x3a\\x3b\\x40\\x7e\\x27\\x22\\x60'
1099
+ console .log (RegExp .escape (' \u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF ' ));
1100
+ // => '\\\t\\\n\\\v\\\f\\\r\\x20\\xa0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029\\ufeff'
1101
+ console .log (RegExp .escape (' 💩' )); // => '💩'
1102
+ console .log (RegExp .escape (' \uD83D ' )); // => '\\ud83d'
1103
+ ```
1104
+
1089
1105
#### ECMAScript: Number[ ⬆] ( #index )
1090
1106
Module [ ` es.number.constructor ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.number.constructor.js ) . ` Number ` constructor support binary and octal literals, [ * example* ] ( https://tinyurl.com/2659klkj ) :
1091
1107
``` js
@@ -2283,6 +2299,18 @@ class RegExp {
2283
2299
```
2284
2300
core-js/proposals/regexp-named-groups
2285
2301
```
2302
+
2303
+ ##### [ ` RegExp ` escaping] ( https://github.com/tc39/proposal-regex-escaping ) [ ⬆] ( #index )
2304
+ ``` ts
2305
+ class RegExp {
2306
+ static escape(value : string ): string
2307
+ }
2308
+ ```
2309
+ [ * CommonJS entry points:* ] ( #commonjs-api )
2310
+ ```
2311
+ core-js/proposals/regexp-escaping
2312
+ ```
2313
+
2286
2314
##### [ ` Promise.allSettled ` ] ( https://github.com/tc39/proposal-promise-allSettled ) [ ⬆] ( #index )
2287
2315
``` ts
2288
2316
class Promise {
@@ -2582,31 +2610,6 @@ core-js(-pure)/actual|full/iterator/dispose
2582
2610
core-js(-pure)/actual|full/async-iterator/async-dispose
2583
2611
```
2584
2612
2585
- ##### [ ` RegExp ` escaping] ( https://github.com/tc39/proposal-regex-escaping ) [ ⬆] ( #index )
2586
- Module [ ` esnext.regexp.escape ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.regexp.escape.js )
2587
- ``` ts
2588
- class RegExp {
2589
- static escape(value : string ): string
2590
- }
2591
- ```
2592
- [ * CommonJS entry points:* ] ( #commonjs-api )
2593
- ```
2594
- core-js/proposals/regexp-escaping
2595
- core-js(-pure)/actual|full/regexp/escape
2596
- ```
2597
- [ * Example* ] ( https://tinyurl.com/ykac4qgy ) :
2598
- ``` js
2599
- console .log (RegExp .escape (' 10$' )); // => '\\x310\\$'
2600
- console .log (RegExp .escape (' abcdefg_123456' )); // => '\\x61bcdefg_123456'
2601
- console .log (RegExp .escape (' Привет' )); // => 'Привет'
2602
- console .log (RegExp .escape (' (){}[]|,.?*+-^$=<>\\ /#&!%:;@~\' "`' ));
2603
- // => '\\(\\)\\{\\}\\[\\]\\|\\x2c\\.\\?\\*\\+\\x2d\\^\\$\\x3d\\x3c\\x3e\\\\\\/\\x23\\x26\\x21\\x25\\x3a\\x3b\\x40\\x7e\\x27\\x22\\x60'
2604
- console .log (RegExp .escape (' \u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF ' ));
2605
- // => '\\\t\\\n\\\v\\\f\\\r\\x20\\xa0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029\\ufeff'
2606
- console .log (RegExp .escape (' 💩' )); // => '💩'
2607
- console .log (RegExp .escape (' \uD83D ' )); // => '\\ud83d'
2608
- ```
2609
-
2610
2613
##### [ ` Math.sumPrecise ` ] ( https://github.com/tc39/proposal-math-sum )
2611
2614
Module [ ` esnext.math.sum-precise ` ] ( https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.math.sum-precise.js )
2612
2615
``` ts
0 commit comments