#include<iostream>
using std::cout; using std::endl;
#include<string>
using std::string;
#include<regex>
using std::regex;
using std::smatch;
int main()
{
string pattern("[^c]ei");
pattern = "[[:alpha:]]*" + pattern + "[[:alpha:]]*";
regex r(pattern);
smatch results;
string test_str = "recepit freind theif receive";
if (regex_search(test_str, results, r))
cout << results.str() << endl;
}
What could be the problem? I'm assuming it has to do with compiler/IDE. I'm using Code::Blocks that comes with the latest MingW. I think its' using gcc 4.7.1.
It would have been better if spurious headers were not shipped with the library; at least some one would know immediately that <regex> just isn't there.