If you've ever had to find and replace, you know that it's important to be able to find within strings. Another less frequently used feature of VS.NET, is to group the find expression and replace the matched string(s) using the variables from the find expression. To do this in Visual Studio 2005, you find a string such as:
"My string
with some text"
"{[^\"]+}\n{[^\"]+}" - This regular expression finds any string within quotes but not containing quotes [^\”]+, containing a newline \n between any string. The {} braces provide the grouping functionality required to save the expression groups and use the values in the replace:
"\1\2" - This will fill in the quotes with the two groups from the find and output:
"My string with some text"
I've had to use this at least a few times and it wasn't easy finding the syntax. Enjoy!