LibRegex: Allow '-' as the last element of a charclass

Fixes #4189.
This commit is contained in:
AnotherTest 2020-11-28 12:28:36 +03:30 committed by Andreas Kling
commit 491e4a8a3b
Notes: sideshowbarker 2024-07-19 01:13:39 +09:00
2 changed files with 12 additions and 0 deletions

View file

@ -485,6 +485,10 @@ TEST_CASE(ECMA262_parse)
"^hel(?<LO>l\\w).$",
"^[-a-zA-Z\\w\\s]+$",
"\\bhello\\B",
"^[\\w+/_-]+[=]{0,2}$", // #4189
"^(?:[^<]*(<[\\w\\W]+>)[^>]*$|#([\\w\\-]*)$)", // #4189
"\\/", // #4189
"\\x", // Even invalid escapes are allowed if ~unicode.
};
for (auto& pattern : patterns) {