C++ 代码 获取匹配的字符串数组或替换
#include
#include
// 使用类 std::regex_iterator 来进行多次搜索....images 开始的相对路径.使用分组即可....= std::regex_replace(kHtmlSnippet,img_regex,rep);
std::cout << tmp << std::endl;
获取以...-成对的字符串
\w+\s*-(\s*[^,;]+)
样本:
fsd-fsdfs fds-fsdfs,werfsd-fewrwrw;fewrwer,fdf -fdf fsdew- fd90
匹配结果:...:[^"])*"
样本: your dollors,10000, 27 years old ,,"10,000","it is "10 Grand",baby",10k
匹配结果: your dollors