通过正则表达式,分开空格直接的字符
如何通过正则表达式,搜索空白字符并将其他字符作为存入ostringstream 或者一个vector里面
首先设置一个vector 用于存储我们所找到的字符
我们将这个vector 设置为string类型, 这个vector将用于储存我们所找的字符串。
std::vector<std::string> lst;
std::string str=tostring->str();
正则表达式的空白字符的意义
通过设置std::regex为空格,并设置一个迭代器将其做迭代循环。
std::regex reg("\\s+"); //将空格设置为正则表达式
std::sregex_token_iterator