LibRegex: Ensure nullable quantifiers backtrack when input remains

Makes patterns like `/(a?b??)*/` correctly match the string
This commit is contained in:
aplefull 2025-03-01 18:23:15 +01:00 committed by Ali Mohammad Pur
parent 40c71ff3c0
commit 61744322ad
Notes: github-actions[bot] 2025-03-02 14:20:04 +00:00
2 changed files with 13 additions and 0 deletions

View file

@ -1118,6 +1118,10 @@ ALWAYS_INLINE ExecutionResult OpCode_JumpNonEmpty::execute(MatchInput const& inp
}
}
if (state.string_position < input.view.length()) {
return ExecutionResult::Failed_ExecuteLowPrioForks;
}
return ExecutionResult::Continue;
}