views:

41

answers:

1

If I need to replace a text

<p>
this text including the paragraph needs to be replaced
</p>

How can I do this with VS2008 "search and replace"?

EDIT

One way is to use regex like suggested by Daniel. Its just pretty complicated. The real searchexpression at the end was:

\<div id="searchStore"\>\n[^\<]*\<[^\>]*\>\n[^\<]*\<[^\>]*\>

Thats to much for simple minded persons like us.

+2  A: 

Check the "Use Regular Expressions" checkbox in the Search/Replace dialog box and create a Regular Expression to match what you need.

(<p>\r\nthis text including the paragraph needs to be replaced\r\n</p>)

would match your example.

Daniel May
This worked when I changed \r\n to \n. I also had to escape brackets.At the end it turns out to be a lot of work... This is a part of VS that pretty much sucks.
Malcolm Frexner
Daniel May