Use boost::regex instead of std::regex. In some implementation std::regex does not match pattern correctly.