https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79522

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #2)
> But even in your second example the behaviour is correct, std::regex_match
> matches the entire string, not any part of it. "def" doesn't match "abcdefg"
> it only matches part of it. Use std::regex_search for that.

You didn't read this.

std::regex_match is only true if the entire sequence matches the regex, not
some subsequence. "def" is a subsequence of "abcdefg". std::regex_match is not
supposed to return true here. You need to use std::regex_search instead.

http://en.cppreference.com/w/cpp/regex/regex_match
http://en.cppreference.com/w/cpp/regex/regex_search

> (And "I don't know how C++ works" is still not a bug)

Still not a bug.

Reply via email to