Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
很明显这里必须我匹配,但是这段代码仍然返回false。
#include <iostream> #include <boost/regex.hpp> using namespace std; using namespace boost; int main() { cout << regex_match("some text", regex("text")) << endl; }
regex_match必须匹配所有给定的字符序列。试试regex_search吧。
regex_match
regex_search