Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2008: Find and Replace with new line character?

Sometimes i would like to search for text containing a new line character and there are other times i would like to replace text with a new line character.

How can i do this with visual studio 2008?

like image 464
burnt1ce Avatar asked Mar 19 '10 15:03

burnt1ce


People also ask

How do I create a new line in Find and Replace in Visual Studio?

In the local searchbox ( Ctrl + F ) you can insert newlines by pressing Ctrl + Enter . If you use the global search ( Ctrl + Shift + F ) you can insert newlines by pressing Shift + Enter .

How do I insert a new line in Find and Replace?

Select the cells that you want to search. On the keyboard, press Ctrl + H to open the Find and Replace dialog box, with the Replace tab active. On the Replace tab, click in the Find What box. On the keyboard, press Ctrl + J to enter the line break character.

How do I find and replace multiple lines in Visual Studio?

CHANGE: The default keyboard shortcut for “Multiline Find/Replace” was Ctrl+Alt+F but it was not applied because this shortcut was already taken by “F# Interactive”. So, the new default shortcut is Ctrl+M, Ctrl+F.


1 Answers

Use a RegEx search:

In the Find Dialog - Expand "Find Options" Check the box for Use: Regular Expressions

Next to the search box there is now an arrow that is active, it will show you available RegEx options/values.

The value you want will be \n. So "SearchValue\n" should do it.

Be aware that that its not a standard RegEx that you use, it's VS specific. Replace can also use the RegEx values.

like image 64
Brian Schmitt Avatar answered Oct 21 '22 15:10

Brian Schmitt