1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:47:44 +00:00

LibRegex: Consider named capture groups as normal capture groups too

This commit is contained in:
AnotherTest 2021-04-05 06:25:57 +04:30 committed by Andreas Kling
parent be0182d049
commit 1bdc1cf77e
2 changed files with 6 additions and 1 deletions

View file

@ -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");
});