Syntax for regular expression search and replace.

Category: visual studio editor


KevinBurton on Thu, 09 Aug 2012 14:48:46

I would like to search and change instance like:

(string.Compare(testingConnections[i].Configuration, "CommerceServerCatalogConnectionString", StringComparison.OrdinalIgnoreCase) == 0)


testingConnections[i].ConfigurationEquals("CommerceServerCatalogConnectionString", StringComparison.OrdinalIgnoreCase)

So this involves regular expressions and it seems that VS's idea of regular expressions differ from the regular expressions used the System.Text.RegularExpression. I need to understand how VS matches a pattern, saves it in a variable and uses it in the replace expression. Like

With "normal" regular expressions I would search for the pattern like:


And replace with

${Variable}.Equals(${String}, ${Comparison})

But I don't understand how this translates to the regular expressions that VS uses. Any ideas?

Thank you.


Abhijit Annaldas on Fri, 24 Aug 2012 17:40:30


Refer this: