[英]tr/regex c++ library - definition of regex pattern
How should i define the regex pattern, when i use the tr1/regex library? 使用tr1 / regex库时,应该如何定义正则表达式模式?
#include <tr1/regex>
const regex pattern("[^-]-[^-]");
is not working... When compiling i get error: 'regex' does not name a type 无法正常工作...编译时出现错误:“ regex”未命名类型
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: regex
在tr1
命名空间中,因此您需要声明正在使用tr1
或指定regex
在tr1
命名空间中:
using namespace tr1;
or 要么
const tr1::regex pattern("[^-]-[^-]");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.