boost::regex pat("(?<=line1=).*(?=line2)");
string card_str("line1=aaa,line2=bbb,line3=ccc");
boost::smatch mat;
cout << boost::regex_match(card_str, mat, pat) << endl;
cout << mat.size() << endl;
for (size_t i = 0; i<mat.size(); i++)
{
cout << "Match " << i << ":" << mat[i] << endl;
}
cout << "----" << endl;
新手求救,斷言匹配不到結果呢
uj5u.com熱心網友回復:
你這正則運算式明顯就有問題,不會的可以在線寫http://tool.chinaz.com/regexuj5u.com熱心網友回復:
在線測驗是沒問題的哦
uj5u.com熱心網友回復:
uj5u.com熱心網友回復:
是不是regex_match和regex_search的問題啊?轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/56527.html
標籤:C++ 語言
上一篇:推薦收藏!C語言入門基礎知識大全
