记录车轮哥哥写的大神级代码,供以后参考
# include iostream # include string # includeregexusingnamespacestd; int main () { string line; regexemail(r((w@ ) w ).(w ) ) ) ); while(Getline(CIN,line ) ) { smatch matches; autocurrent=cbegin(line ); autolast=cend(line ); while (目前!=last(if ) regex_search(current,last,matches,email ) ) { ssub_match match=matches[0]; current=match.second; coutmatch.str () endl; } else { break; } }} return 0; }这是处理正则匹配的代码,用于简单的正则表达式、迭代器和基本的字符串操作。