I am trying to use the code below to make changes and tell me the number of changes that have been made.
int matchCount = 0;
currentFileText = Regex.Replace(currentFileText, currentRedactionRule.inputString, currentRedactionRule.patternString, m =>
I would prefer not to use a MatchCollection and a foreeach outside of this call. Performance is important to me and I would rather get this value if it already exists.
Hopefully this makes sense. Any help would be greatly appreciated.