64,637
社区成员
发帖
与我相关
我的任务
分享
string line;
string tmp;
ifstream fin("/home/linsen/桌面/wori");
while (getline(fin,tmp)){
line+=tmp;
}
boost::regex e(".*", boost::regex::icase);
boost::smatch m;
bool matched=boost::regex_match(line,m,e,boost::match_default);
cout<<matched<<endl;
if (matched) {
for (size_t i = 0; i < m.size(); ++i) {
cout << m[i] << endl;
}
} else
cout << "no matched" << endl;
}