mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:17:44 +00:00
LibRegex: Consider named capture groups as normal capture groups too
This commit is contained in:
parent
be0182d049
commit
1bdc1cf77e
2 changed files with 6 additions and 1 deletions
|
@ -44,9 +44,10 @@ test("basic named captures", () => {
|
|||
let re = /f(?<os>o.*)/;
|
||||
let res = re.exec("fooooo");
|
||||
|
||||
expect(res.length).toBe(1);
|
||||
expect(res.length).toBe(2);
|
||||
expect(res.index).toBe(0);
|
||||
expect(res[0]).toBe("fooooo");
|
||||
expect(res[1]).toBe("ooooo");
|
||||
expect(res.groups).not.toBe(undefined);
|
||||
expect(res.groups.os).toBe("ooooo");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue