Skip to content

Commit d06eff5

Browse files
committed
Minor.
1 parent 9d7aefc commit d06eff5

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
@@ -1600,7 +1600,7 @@ var XRegExp = (function(undefined) {
16001600
);
16011601

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

0 commit comments

Comments
 (0)