Skip to content

Commit

Permalink
Fix single regex search replace
Browse files Browse the repository at this point in the history
Fix an issue where regular expression search and replace was not being done correctly when MatchAllOccurences is not specified.
  • Loading branch information
chrdavis committed Nov 2, 2019
1 parent df4fa54 commit 1efe5bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/powerrename/lib/PowerRenameRegEx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 1efe5bf

Please sign in to comment.