Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stl/inc/regex
Original file line number Diff line number Diff line change
Expand Up @@ -3521,7 +3521,7 @@ bool _Matcher3<_BidIt, _Elem, _RxTraits, _It, _Alloc>::_Find_first_inner_capture

case _N_assert:
case _N_neg_assert:
if (_Find_first_inner_capture_group(static_cast<_Node_assert*>(_Nx), _Loop_state)) {
if (_Find_first_inner_capture_group(static_cast<_Node_assert*>(_Nx)->_Child, _Loop_state)) {
_Found_group = true;
_Nx = nullptr;
}
Expand Down
10 changes: 10 additions & 0 deletions tests/std/tests/VSO_0000000_regex_use/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2223,6 +2223,15 @@ void test_gh_5790() {
}
}

void test_gh_5792() {
// GH-5792: <regex>: regex_match() throws regex_error(error_stack)
// when a repeated pattern contains a lookahead assertion
g_regexTester.should_match("", "(?:(?=ab))*");
g_regexTester.should_match("", "(?:(?!ab))*");
g_regexTester.should_not_match("bc", "(?:(?=ab))+bc");
g_regexTester.should_match("bc", "(?:(?!ab))+bc");
}

int main() {
test_dev10_449367_case_insensitivity_should_work();
test_dev11_462743_regex_collate_should_not_disable_regex_icase();
Expand Down Expand Up @@ -2276,6 +2285,7 @@ int main() {
test_gh_5672();
test_gh_5774();
test_gh_5790();
test_gh_5792();

return g_regexTester.result();
}