1

This regex gives a runtime error

#include <regex>
int main( int argc, const char* argv[] )
{
std::regex test("[^*]");
}

Error:

 ./test 
terminate called after throwing an instance of 'std::regex_error'
  what():  regex_error
Aborted

Presumabily because some of the things do not work in ecmascript c++11. I've tried some variations (basic, extended, grep, egrep) but with no success.

How to do that regex in C++11 please? (Boost is not an option).

pakore
  • 11,395
  • 12
  • 43
  • 62

1 Answers1

1

Apparently, the implementation of <regex> in C++11 is not complete until gcc 4.9.

Is gcc 4.8 or earlier buggy about regular expressions?

Community
  • 1
  • 1
pakore
  • 11,395
  • 12
  • 43
  • 62