1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:57:35 +00:00

LibRegex: Allow a '?' suffix for brace quantifiers

This fixes another compat point in #6042.
This commit is contained in:
AnotherTest 2021-04-10 08:31:53 +04:30 committed by Andreas Kling
parent 8d7bcc2476
commit e9279d1790
3 changed files with 15 additions and 9 deletions

View file

@ -119,3 +119,11 @@ test("named capture group with two '?' qualifiers", () => {
expect(res[1]).toBeUndefined();
expect(res.groups.foo).toBeUndefined();
});
// #6042
test("non-greedy brace quantifier", () => {
let res = /a[a-z]{2,4}?/.exec("abcdefghi");
expect(res.length).toBe(1);
expect(res[0]).toBe("abc");
});