1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

LibRegex: Fix greedy/reluctant modifiers in PosixExtendedParser

Also fixes the issue with assertions causing early termination when
they fail.
This commit is contained in:
AnotherTest 2020-11-19 18:57:39 +03:30 committed by Andreas Kling
parent 45e5661296
commit 92ea9ed4a5
Notes: sideshowbarker 2024-07-19 01:14:53 +09:00
5 changed files with 42 additions and 26 deletions

View file

@ -334,6 +334,16 @@ TEST_CASE(match_all_character_class)
EXPECT(&result.matches.at(0).view.characters_without_null_termination()[0] != &str.view().characters_without_null_termination()[1]);
}
TEST_CASE(match_character_class_with_assertion)
{
Regex<PosixExtended> re("[[:alpha:]]+$");
String str = "abcdef";
RegexResult result = match(str, re);
EXPECT_EQ(result.success, true);
EXPECT_EQ(result.count, 1u);
}
TEST_CASE(example_for_git_commit)
{
Regex<PosixExtended> re("^.*$");