wstring和string简单正则表达式使用
生活随笔
收集整理的這篇文章主要介紹了
wstring和string简单正则表达式使用
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
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;
}
總結(jié)
以上是生活随笔為你收集整理的wstring和string简单正则表达式使用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: debian apache php my
- 下一篇: K8S+Helm 安装 Jupyterh