boost的regex无法匹配数字.换行?

gnhao gnhao 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
regex regstr;
regstr= "</p>(?<content>\\d*?)<p";
//regstr="(?<content>dsa*?)";
// CString st=Get("http://www.discuz.net/archiver/?tid-1423782.html");

string testString(":45</p>沙发支持323·2!!<p ");
boost::smatch what;
string::const_iterator beg=testString.begin();
string::const_iterator end=testString.end();


while(regex_search(beg,end, what, regstr) )
{

std::cout<< "Name:" <<what["content"].str() << std::endl;
beg=what[0].second;
}


regstr= "</p>(?<content>\\d*?)<p";
换成regstr= "</p>(?<content>\d*?)<p";也不行.晕...
如何换行了.类似于.
(":45</p>沙发支
持323·2!!<p
也匹配不出<p>里的内容..晕啊...
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
gnhao
界面 15,977 成员 115,865 内容