tr/regex c++ library - definition of regex pattern
How should i defi开发者_运维知识库ne the regex pattern, when i use the tr1/regex library?
#include <tr1/regex>
const regex pattern("[^-]-[^-]");
is not working... When compiling i get error: ‘regex’ does not name a type
regex
is in the tr1
namespace so you either need to declare that you are using tr1
or specify that regex
is in the tr1
namespace:
using namespace tr1;
or
const tr1::regex pattern("[^-]-[^-]");
精彩评论