案例

#include <iostream>
#include <regex>
using namespace std;

int main()
{
    string str{ "ang1\tm1-n1-ng1 ang1" };

    regex e{ "(^|[ \\-\\s])([mn])(g*)1" };

    cout << regex_replace(str, e, "$1$2$3");
}
分类: 标签: 正则表达式 regex

评论

-- 评论已关闭 --

全部评论