VS 11 and the new Find feature with .NET regular expressions

When Microsoft released Visual Studio .NET and the .NET Framework 1.0 back in 2002, one of the quirks of the IDE was that while the .NET Framework has one syntax for regular expressions, the Find dialog has another syntax for them. This has been so for ten years and five Visual Studio releases (2002, 2003, 2005, 2008 and 2010), but finally in VS 11 the IDE will use the .NET Framework syntax for regular expressions, and wildcards support will be removed.

This has two consequences for developers extending Visual Studio, either with macros or with add-ins using the EnvDTE.EditPoint.FindPattern(pattern, vsFindOptionsValue, …) method of the automation model:

  • In VS 11 the vsFindOptionsWildcards value is no longer supported. You need to use regular expressions now.
  • In VS 11 the vsFindOptionsRegularExpression value now refers to .NET regular expressions, not to VS.NET regular expressions. That is, likely you need to change the pattern value for the FindPattern method to work the same in VS 2010 and VS 11.