mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibRegex: Allow the pattern to match the zero-length end of the string
...only if Multiline is not enabled. Fixes #11940.
This commit is contained in:
parent
c11be92e23
commit
9eccd4c56e
Notes:
sideshowbarker
2024-07-17 20:32:07 +09:00
Author: https://github.com/alimpfard
Commit: 9eccd4c56e
Pull-request: https://github.com/SerenityOS/serenity/pull/12038
Issue: https://github.com/SerenityOS/serenity/issues/11940
Issue: https://github.com/SerenityOS/serenity/issues/12033
2 changed files with 5 additions and 1 deletions
|
@ -224,7 +224,10 @@ RegexResult Matcher<Parser>::match(Vector<RegexStringView> const& views, Optiona
|
|||
}
|
||||
}
|
||||
|
||||
for (; view_index < view_length; ++view_index) {
|
||||
for (; view_index <= view_length; ++view_index) {
|
||||
if (view_index == view_length && input.regex_options.has_flag_set(AllFlags::Multiline))
|
||||
break;
|
||||
|
||||
auto& match_length_minimum = m_pattern->parser_result.match_length_minimum;
|
||||
// FIXME: More performant would be to know the remaining minimum string
|
||||
// length needed to match from the current position onwards within
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue