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

LibRegex: Treat brace quantifiers with invalid contents as literals

Fixes #6208.
This commit is contained in:
AnotherTest 2021-04-10 09:10:44 +04:30 committed by Andreas Kling
parent 25d336bc27
commit 1b071455b1
2 changed files with 32 additions and 8 deletions

View file

@ -127,3 +127,12 @@ test("non-greedy brace quantifier", () => {
expect(res.length).toBe(1);
expect(res[0]).toBe("abc");
});
// #6208
test("brace quantifier with invalid contents", () => {
let re = /{{lit-746579221856449}}|<!--{{lit-746579221856449}}-->/;
let res = re.exec("{{lit-746579221856449}}");
expect(res.length).toBe(1);
expect(res[0]).toBe("{{lit-746579221856449}}");
});