I have a string like below This is a test and the Test is part of unit testing
I want to replace all the “test” with “xxxtestxxxx” so the output should be
This is a xxxtestxxxx and the xxxTestxxxx is part of unit testing → (including the original cases(test/Test)
I’m using the following function
System.Text.RegularExpressions.Regex.Replace(“string”,“regexpattern”,“replacestring”)
System.Text.RegularExpressions.Regex.Replace(tempString,“(?i)\btest\b”, “xxxtestxxxx”)
My challenge is how do I access the matched expressesion ouput (2nd parameter) in the last parameter replacestring…
thanks for the replies… the above suggestions may not work for me…
what I want is the input string could be case sensitive… so for ex : “test” or “Test” or “teST” etc., and the replacement should happen
xxxtestxxx xxxTestxxx xxxteSTxxx
with the above suggestions I will not be able to get that… hope I clarified…