no matching function for call to ‘regex_search(…)'
问题 Given an old-style const char * pointer and a length, is there a way to call std::regex_search() on it without first copying the contents of the buffer into a std::string ? Here is a simple example of the problem I have: #include <regex> int main() { const char *text = "123 foobar 456"; const size_t len = strlen(text); const std::regex rx(" (.+)bar"); std::smatch what; std::regex_search( text, text+len, what, rx); // <- problematic line return 0; } I thought the 5th std::regex_search() that