I have a large solution with a lot of lines that I need to replace.
In Visual Studio, you can search and replace with the aid of regular expressions.
I want to replace lines like:
rst.Fields("CustomerName").Value
rst.Fields("Address").Value
rst.Fields("Invoice").Value
To:
row("CustomerName").ToString()
row("Address").ToString()
row("Invoice").ToString()
Thus keeping the dynamic text part, which can vary.
Is this possible and how?
Update, solution:
Search: rst.Fields{\(.*\)}\.Value
Replace: rst\1.ToString()
Thanks JaredPar!
Try the following
ASpecificCommand(\(.*\))\.ASpecificPropertyATotallyDifferentCommand\1.ATotallyDifferentPropertyNote: This is not a perfect solution. Since there are
(s involved and hence matching of nested parens, a regex won’t ever be a perfect solution. However it should get the job done for the specific pattern you posted