I compiled this program using g++4.7 -std=c++11. It compiles but won't run. Can you give me help to get this working?
pattern = "[[:alpha:]]*" + pattern + "[[:alpha:]]*";
std::string test_str = "receipt freind theif receive";
if(std::regex_search(test_str, results, r))
std::cout << results.str() << std::endl;
When I run the program I get:
terminate called after throwing an instance of 'std::regex_error'
Abort trap (core dumped)
Last edited on
Works with clang++ (prints "freind"), but to use regex with gcc, you're going to need boost.