I try to follow the instructions at regex visual studio by adding the following line to the header file:
#include <iostream>
#include <regex>
And add the following line to the .cpp file:
using namespace std;
void CTestMemcmpDlg::OnBnClickedButton3()
{
// TODO: Add your control notification handler code here
std::regex rex1(R"((.+?)([^\.]+.[^\.]+)$)");
std::smatch m;
std::string str = "c:\Python27\REGEX\test_regex.py";
if (regex_search(str, m, rex1)) {
std::cout << "Path: " << m[1] << std::endl;
std::cout << "File name: " << m[2] << std::endl;
}
}
But always get the compiler error:
error C2039: 'regex' : is not a member of 'std'
Why?