1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:47:35 +00:00

LibRegex: Make '.' reject matching LF / LS / PS as per the ECMA262 spec

Previously we allowed it to match those, but the ECMA262 spec disallows
these (except in DotAll).
This commit is contained in:
Ali Mohammad Pur 2023-02-15 09:55:43 +03:30 committed by Andreas Kling
parent 1e022295c4
commit 936a9fd759
4 changed files with 59 additions and 43 deletions

View file

@ -697,6 +697,7 @@ TEST_CASE(ECMA262_match)
{ "^[a-sy-z]$"sv, "b"sv, true, ECMAScriptFlags::Insensitive },
{ "^[a-sy-z]$"sv, "y"sv, true, ECMAScriptFlags::Insensitive },
{ "^[a-sy-z]$"sv, "u"sv, false, ECMAScriptFlags::Insensitive },
{ "."sv, "\n\r\u2028\u2029"sv, false }, // Dot should not match any of CR/LF/LS/PS in ECMA262 mode without DotAll.
};
// clang-format on