Fix a bug in regex wrapper

This commit is contained in:
Tindy X 2019-12-21 11:15:01 +08:00
parent 97a1a123ba
commit d31bdd9597
No known key found for this signature in database
GPG Key ID: C6AD413169968D58

View File

@ -537,7 +537,7 @@ std::string regReplace(std::string src, std::string match, std::string rep)
if(rep.find("$") != rep.npos)
rep = replace_all_distinct(rep, "$", "\\");
pcrecpp::RE reg(match);
if(reg.Replace(rep, &result))
if(reg.GlobalReplace(rep, &result))
return result;
else
return src;