ningth_sun
ningth_sun
关注数: 0
粉丝数: 0
发帖数: 7
关注贴吧数: 1
【Regex库】【中英文匹配】例子 #include "stdafx.h"#include #include #include #include #include using namespace std;//using namespace boost;boost::wregex expression(L"^\\s*我+\\s*[想|爱|恨|扁]+\\s*你");int main(int argc, char* argv[]){locale loc( "Chinese-simplified" );wcout.imbue(loc);std::wstring in = L"我我我我 爱爱爱爱爱 你";static boost::wsmatch what;cout << "enter test string" << endl;//getline(cin,in);if(boost::regex_match(in.c_str(), what, expression)){for(int i=0;i
我要做版主
1
下一页