Fix single regex search replace

Fix an issue where regular expression search and replace was not being done correctly when MatchAllOccurences is not specified.
This commit is contained in:
Chris Davis
2019-11-01 23:56:29 -07:00
parent df4fa549ef
commit 1efe5bff9f

View File

@@ -213,7 +213,7 @@ HRESULT CPowerRenameRegEx::Replace(_In_ PCWSTR source, _Outptr_ PWSTR* result)
std::wsmatch m;
if (std::regex_search(sourceToUse, m, pattern))
{
res = sourceToUse.replace(m.prefix().length(), searchTerm.length(), replaceTerm);
res = sourceToUse.replace(m.prefix().length(), m.length(), replaceTerm);
}
}
}