开发者

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("[^-]-[^-]");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜