Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to replace multiple lines in Visual Studio 2008

I need to do a find and replace, where I need to replace 2 lines at time. Does anyone know how to do this in the VS2008 IDE?

To clarify, i want to replace 2 lines with 1 line.

Many thanks

like image 614
Iain Hoult Avatar asked Jan 22 '23 20:01

Iain Hoult


1 Answers

Thanks to František Žiačik for the answer to this one.

To perform a find/replace, replacing multiple lines, you need to switch on regular expressions and use a line break (\n) between your lines, also using (:b*) at the start of each line to handle any tabs or spaces tabs.

So to find:

line one
line two

you would search for ":bline one\n:bline two" (without the quotes)

like image 162
Iain Hoult Avatar answered Feb 15 '23 23:02

Iain Hoult