and this is s_spilt():
vector<string> s_split(const string& in, const string& delim) {
regex re{ delim};
return vector<string> {
sregex_token_iterator(in.begin(), in.end(), re, -1),
sregex_token_iterator()
};
}
I try this code:
vector<string> vec = s_split(str,"\|");
it still has this problem,then I try
vector<string> vec = s_split(str,R"(\|)");
Successfully resolved