Skip to content

Commit 37dbdb1

Browse files
Revert "Revert "Minor.""
This reverts commit 1c46929.
1 parent 1c46929 commit 37dbdb1

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/xregexp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,7 @@ var XRegExp = (function(undefined) {
15731573
);
15741574

15751575
/* Named backreference: `\k<name>`. Backreference names can use the characters A-Z, a-z, 0-9, _,
1576-
* and $ only.
1576+
* and $ only. Also allows numbered backreferences as `\k<n>`.
15771577
*/
15781578
add(
15791579
/\\k<([\w$]+)>/,

tests/perf/perf.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,9 @@
191191

192192
(function() {
193193
var str = Array(30 + 1).join('hello world ') + 'http://xregexp.com/path/to/file?q=1';
194-
var regexp = new RegExp('\\b([^:/?\\s]+)://([^/?\\s]+)([^?\\s]*)\\??([^\\s]*)');
195-
var xregexp = XRegExp('\\b([^:/?\\s]+)://([^/?\\s]+)([^?\\s]*)\\??([^\\s]*)');
194+
var pattern = '\\b([^:/?\\s]+)://([^/?\\s]+)([^?\\s]*)\\??([^\\s]*)';
195+
var regexp = new RegExp(pattern);
196+
var xregexp = XRegExp(pattern);
196197

197198
suites.push(Benchmark.Suite('Regex object type')
198199
.add('RegExp object', function() {

xregexp-all.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ var XRegExp = (function(undefined) {
16051605
);
16061606

16071607
/* Named backreference: `\k<name>`. Backreference names can use the characters A-Z, a-z, 0-9, _,
1608-
* and $ only.
1608+
* and $ only. Also allows numbered backreferences as `\k<n>`.
16091609
*/
16101610
add(
16111611
/\\k<([\w$]+)>/,

0 commit comments

Comments
 (0)