Yes, I want to search and replace all the occurrences of the pattern and replace them with a target string. I am trying to use Regex.Replace(src, pattern, target), is there a flag like \g to put in pattern to make it work, or what?
There is no \g
or concept of a global search, as the .NET Regex
class is global by default. In other words, it should just work, assuming you've written your regular expression properly.
You might want to test it in Regex Hero and then once you've got it working click the .NET
button at the top to get the code with properly escaped strings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With