In c#, I am trying to replace any string between two given strings, primarily using Regex. For example, if I have:
TextBlock Text="this is a test"
Then I want to change it to:
TextBlock Text="Any given string comes here"
For that, after some search, I tried this method:
Regex.Replace(inputString, @"(?<=TextBlock Text=\")(\w+?)(?=\")", "Any given string comes here");
But I've got many errors, saying "An object reference is required for non-static field, method or property". Is there any efficient way to do this with Regex? Thanks.