I would like to modify the value of the "data source" component in a connection string. I'm thinking of the following solution:
Using this regex pattern:
"data source\=((\w|\-)+?\\{1}\w+?)\;"
I can obtain the following string matches:
Match.Groups[0].Value = "data source=MY-PC\SQLEXPRESS;"
Match.Groups[1].Value = "MY-PC\SQLEXPRES"
So in the connection string firstly I would like to find the part matching with the "data source=something;", and secondly replace just the "something" in the connection string. How to do that?