File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ const nativeTokens = {
4949 'class' : / \\ (?: [ 0 - 3 ] [ 0 - 7 ] { 0 , 2 } | [ 4 - 7 ] [ 0 - 7 ] ? | x [ \d A - F a - f ] { 2 } | u (?: [ \d A - F a - f ] { 4 } | { [ \d A - F a - f ] + } ) | c [ A - Z a - z ] | [ \s \S ] ) | [ \s \S ] /
5050} ;
5151// Any backreference or dollar-prefixed character in replacement strings
52- const replacementToken = / \$ (?: { ( [ \w $ ] + ) } | < ( [ \w $ ] + ) > | ( \d \d ? | [ \s \S ] ) ) / g ;
52+ const replacementToken = / \$ (?: \ {( [ \p { ID_Start } $ _ ] [ \p { ID_Continue } $ _ \u200C \u200D ] * ) \ }| < ( [ \p { ID_Start } $ _ ] [ \p { ID_Continue } $ _ \u200C \u200D ] * ) > | ( \d \d ? | [ \s \S ] ) ) / gu ;
5353// Check for correct `exec` handling of nonparticipating capturing groups
5454const correctExecNpcg = nativ . exec . call ( / ( ) ? ?/ , '' ) [ 1 ] === undefined ;
5555// Check for ES6 `flags` prop support
@@ -1792,7 +1792,7 @@ XRegExp.addToken(
17921792 * and $ only. Also allows numbered backreferences as `\k<n>`.
17931793 */
17941794XRegExp . addToken (
1795- / \\ k < ( [ \w $ ] + ) > / ,
1795+ / \\ k < ( [ \p { ID_Start } $ _ ] [ \p { ID_Continue } $ _ \u200C \u200D ] * ) > / u ,
17961796 function ( match ) {
17971797 // Groups with the same name is an error, else would need `lastIndexOf`
17981798 const index = isNaN ( match [ 1 ] ) ? ( this . captureNames . indexOf ( match [ 1 ] ) + 1 ) : + match [ 1 ] ;
@@ -1844,7 +1844,7 @@ XRegExp.addToken(
18441844 * Python-style named capture as octals.
18451845 */
18461846XRegExp . addToken (
1847- / \( \? P ? < ( [ \w $ ] + ) > / ,
1847+ / \( \? P ? < ( [ \p { ID_Start } $ _ ] [ \p { ID_Continue } $ _ \u200C \u200D ] * ) > / u ,
18481848 function ( match ) {
18491849 // Disallow bare integers as names because named backreferences are added to match arrays
18501850 // and therefore numeric properties may lead to incorrect lookups
You can’t perform that action at this time.
0 commit comments