The regex_search function isn't quite behaving as expected.
#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;
}
The output is
0
What's going on?
regex_searchyet.std::regex_searchfunction if it doesn't work (and his example isn't really an edge case)? I'd rather miss this function than use it while it silently just doesn't work.