views:

231

answers:

2

Is it possible to make use of Visual Studio 2005/2008 "Find" and "Replace" functionality along with regular expression to replace multiple lines of already coded C# code into a single line of code?

Note that Visual Studio's "Find" and "Replace" regular expression syntax differs from .NET Framework.

+1  A: 

\n is the newline character in the Find & Replace syntax. Just replace \n with nothing.

uosɐſ
How do I perform "Matches any single character including line breaks".
Lopper
Like this, I believe: [.\n]
uosɐſ
A: 

Try:

.|\n

The "." matches any character, the "\n" matches a newline character, and the "|" tells you to match either the "." or the "\n."

Sadhana
Wouldn't that just delete everything?
uosɐſ
I was responding to his "How do I perform "Matches any single character including line breaks" question.
Sadhana