c++正则表达式删除字符串中特殊字符
#include <iostream>
#include <string>
#include <regex>
using namespace std;
int main()
string buff = "a &%>b+c-d";
regex pattern("[0-9\'!\"#$%&\'\(\)*+,-./:;<=>?@,。?★、…【】《》?“”‘\'![\\]^_`{|}~\s]+");
cout << regex_replace(buff, pattern, "") << endl;
return 0;
}