[Bug libstdc++/79522] std::regex_match always returns false
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Feb 15 08:59:00 GMT 2017
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 #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
You did get them swapped. Obviously the regex "abcdefg" can't match "def".
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.
(And "I don't know how C++ works" is still not a bug)
More information about the Gcc-bugs
mailing list