regex_search 函数的行为并不像预期的那样。
#include <iostream>
#include <regex>
#include <string>
using namespace std;
int main()
{
string str = "Hello world";
const regex rx("Hello");
cout << regex_search(str.begin(), str.end(), rx) << endl;
return 0;
}
输出是
0
这是怎么回事?