求大家幫忙想想,在visual c++裡面對一個給定的中文文本怎麼把英語和標點符號過濾掉?
#include <iostream>
#include <string>
#include <regex>
using namespace std;
int main()
{
string s = "中文123,英文abc...";
string r = "";
const char* c = s.c_str();
for (int i = 0; i < s.length(); i++)
if (c[i] > 256 || c[i] < 0)
r += c[i];
cout << r << endl;
}