64,648
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <string>
#include <boost/regex.hpp>
using namespace std;
using namespace boost;
int main()
{
string test[]={"test it nTray","strTray here","Power here","Light here","test end trTray"};
regex reg("strTray|Power|Light");
cmatch what;
for(int i=0;i<5;i++)
{
if(regex_search(test[i].c_str(),what,reg))
cout << test[i] <<endl;
}
}