mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:57:45 +00:00
LibRegex: Do not treat repeats followed by fallthroughs as atomic
This commit is contained in:
parent
31c9fe5c32
commit
b1ca2e5e39
2 changed files with 18 additions and 1 deletions
|
@ -995,6 +995,9 @@ TEST_CASE(optimizer_atomic_groups)
|
|||
Tuple { "[^x]+y"sv, "ay"sv, true },
|
||||
// .+ should not be rewritten here, as it's followed by something that would be matched by `.`.
|
||||
Tuple { ".+(a|b|c)"sv, "xxa"sv, true },
|
||||
// (b+)(b+) produces an intermediate block with no matching ops, the optimiser should ignore that block when looking for following matches and correctly detect the overlap between (b+) and (b+).
|
||||
// note that the second loop may be rewritten to a ForkReplace, but the first loop should not be rewritten.
|
||||
Tuple { "(b+)(b+)"sv, "bbb"sv, true },
|
||||
};
|
||||
|
||||
for (auto& test : tests) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue