3,882
社区成员
发帖
与我相关
我的任务
分享String name_pt = "^[A-Za-z0-9_\u4e00-\u9fa5]+$";可以正确判断,但boost就说不匹配std::string name_pt = "^[A-Za-z0-9_\u4e00-\u9fa5]+$";//英文字母、数字、下划线组合
std::string userName = std::string(this->et_userName->GetValue().mb_str());
bool flag = boost::regex_match(userName, name_exp)
boost::wregex wsname_pt(L"(^[A-Za-z0-9_\u4e00-\u9fa5]+$)");//宽字符 英文字母、数字、下划线、中文组合
std::wstring wsUserName = this->et_userName->GetValue().ToStdWstring();
bool flag = boost::regex_match(wsUserName, wsname_pt);