mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 05:06:36 +02:00
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:
@@ -213,7 +213,7 @@ HRESULT CPowerRenameRegEx::Replace(_In_ PCWSTR source, _Outptr_ PWSTR* result)
|
|||||||
std::wsmatch m;
|
std::wsmatch m;
|
||||||
if (std::regex_search(sourceToUse, m, pattern))
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user