Find and Replace in Visual Studio 2005 using Regular Expressions

The search dialouge in Visual Studio 2005 supports Regular Expressions, which is neat. A gotcha is that it's not the regular expression you might be used to... it's a special kind ... Here's a quicky-quick tutorial: To find all entries of GetString("variable string") (to insert appropriate values in a resource file, for example), you do this:
  • CTRL+SHIFT+F (find in files (to get the result as a list))
  • Type GetString\({:q}\)
  • Find Options: Check Use -> Regular expressions
  • Result Options: Find results 1 window
  • ALT+F (Find All)
Sweet. Quick explanation:
  • "\" escapes just like in "real regex"
  • "{" and "}" groups results (instead of "(" and ")")
  • ":q" means "match quoted string"

Comments

Popular posts from this blog

Auto Mapper and Record Types - will they blend?

Unit testing your Azure functions - part 2: Queues and Blobs

Testing WCF services with user credentials and binary endpoints