std::regex e("([ ])3DSMAX(\d{4})_MAIN([^ ])");
//std::regex e("([^ ])3DSMAX(\d{4})_MAIN");
std::smatch sub_match;
//从第一行中解析请求方法、路径和 HTTP 版本
std::string line = “VRAY30_RT_FOR_3DSMAX2016_MAIN”;
if (std::regex_match(line, sub_match, e)) {
int i = 100;
}
std::wregex re(L"([ ])3DSMAX(\d{4})_MAIN([^ ]*)");
std::wsmatch w_sub_match;
std::wstring w_line = L"VRAY30_RT_FOR_3DSMAX2016_MAIN";
if (std::regex_match(w_line, w_sub_match, re)) {
int i = 100;
}
wstring和string简单正则表达式使用
最新推荐文章于 2023-01-30 12:37:25 发布