File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
test/std/re/re.const/re.matchflag Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1889,6 +1889,9 @@ void __r_anchor_multiline<_CharT>::__exec(__state& __s) const {
1889
1889
if (__s.__current_ == __s.__last_ && !(__s.__flags_ & regex_constants::match_not_eol)) {
1890
1890
__s.__do_ = __state::__accept_but_not_consume;
1891
1891
__s.__node_ = this ->first ();
1892
+ } else if (__s.__current_ == __s.__first_ && !(__s.__flags_ & regex_constants::match_not_eol)) {
1893
+ __s.__do_ = __state::__accept_but_not_consume;
1894
+ __s.__node_ = this ->first ();
1892
1895
} else if (__multiline_ && std::__is_eol (*__s.__current_ )) {
1893
1896
__s.__do_ = __state::__accept_but_not_consume;
1894
1897
__s.__node_ = this ->first ();
Original file line number Diff line number Diff line change @@ -47,5 +47,19 @@ int main(int, char**)
47
47
assert ( std::regex_search (target, re, std::regex_constants::match_not_eol));
48
48
}
49
49
50
+ {
51
+ std::string target = " foo" ;
52
+ std::regex re (" $" );
53
+ assert (std::regex_search (target, re));
54
+ assert (!std::regex_search (target, re, std::regex_constants::match_not_eol));
55
+ }
56
+
57
+ {
58
+ std::string target = " foo" ;
59
+ std::regex re (" $" );
60
+ assert (!std::regex_match (target, re));
61
+ assert (!std::regex_match (target, re, std::regex_constants::match_not_eol));
62
+ }
63
+
50
64
return 0 ;
51
65
}
You can’t perform that action at this time.
0 commit comments