1

This code compiles and run (Parsing backtrace_symbols)

In gcc I get "regex_error" exception on call to regex_match while in VS2017 it doesnt?!?

const std::regex r( R"(\((\w*)\+\w*\)\s+\[(\w+)\])");
std::smatch m;
const bool bMatch = std::regex_match(curStr,m,r);

Can someone explain?

Nir
  • 1,608
  • 1
  • 17
  • 29
  • GCC (stdlibc++) and never really worked too well, what version are you using? – DeiDei Apr 09 '17 at 15:27
  • @DeiDei, Never? It's been implemented for a while now and [works on trunk](https://wandbox.org/permlink/qyPSFvU8L2NCKE0z). – chris Apr 09 '17 at 15:30
  • @chris Bad choice of word on my part. I meant there's been numerous questions on SO about this. That's why I asked for the version the OP is using. – DeiDei Apr 09 '17 at 15:31
  • Seems that this also happens with Intel Compiler (icpc). I finally overcome this using boost::regex instead of std::regex – Nir Apr 12 '17 at 07:13

1 Answers1

1

I think this is a bug up to version 4.8.5

You can see it here

I even found some bug up to version 5.3.0
So I suggest you at least use version 5.4.0 or upper with gcc

See a bug in version 5.3.0

Community
  • 1
  • 1
Shakiba Moshiri
  • 21,040
  • 2
  • 34
  • 44