mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:48:11 +00:00
LibRegex: Consider the inverse=true case when finding pattern overlap
Previously we were only checking for overlap when the range wasn't in inverse mode, which made us miss things like /[^x]x/; this patch makes it so we don't miss that.
This commit is contained in:
parent
936a9fd759
commit
af441bb939
2 changed files with 5 additions and 3 deletions
|
@ -984,6 +984,8 @@ TEST_CASE(optimizer_atomic_groups)
|
|||
Tuple { "(1+)0"sv, "10"sv, true },
|
||||
// Rewrite should not skip over first required iteration of <x>+.
|
||||
Tuple { "a+"sv, ""sv, false },
|
||||
// 'y' and [^x] have an overlap ('y'), the loop should not be rewritten here.
|
||||
Tuple { "[^x]+y"sv, "ay"sv, true },
|
||||
};
|
||||
|
||||
for (auto& test : tests) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue