您的位置:首页 > 编程语言 > C语言/C++

c++ boost判断一个字符串中是否含有汉字的代码

2011-07-25 10:41 826 查看
for (set<string>::iterator it=institutionnames.begin();it!=institutionnames.end();it++)
{
wstring wtemp=strp.String2Wstring(*it);
boost::wregex wreg(L"[\u4e00-\u9fa5]");
boost::wsmatch m;
wstring::const_iterator mybegin=wtemp.begin();
wstring::const_iterator myend=wtemp.end();

if (wtemp.size()>3)
{
if (boost::regex_search(mybegin,myend,m,wreg))
{
standardwps.push_back(*it);

}

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: