add non-matching example

This commit is contained in:
Kevin Gibbons 2022-08-07 20:10:26 -07:00 committed by Philip Chimento
parent 52284ba4bb
commit 418419a345
1 changed files with 3 additions and 0 deletions

View File

@ -17,3 +17,6 @@ assert.compareArray(["bb", undefined, "bb"], "bb".match(/(?:(?<x>a)|(?<x>b))\k<x
let matchResult = "aabb".match(/(?:(?:(?<x>a)|(?<x>b))\k<x>){2}/);
assert.compareArray(["aabb", undefined, "bb"], matchResult);
assert.sameValue(matchResult.groups.x, "bb");
let notMatched = "abab".match(/(?:(?:(?<x>a)|(?<x>b))\k<x>){2}/);
assert.sameValue(null, notMatched);