mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:47:45 +00:00
LibRegex: Allow a '?' suffix for brace quantifiers
This fixes another compat point in #6042.
This commit is contained in:
parent
8d7bcc2476
commit
e9279d1790
3 changed files with 15 additions and 9 deletions
|
@ -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");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue