Notepad++ find string with a new-line and replace

find and replacenotepadtags

[Notepad++ Question]

How do I use find-and-replace to replace the attribute of a series of tags using expression?

Case scenario:

Let's say I have a couple of lines of something like this:

<li><a title="Bla bla" href=
    "http://www.url.com/etc">Text</a></li>

And I want to replace them with this:

<li><a title="Bla bla" href="">Text</a></li>

Note the new line and double tabs on the original.

Best Answer

Speaking specifically about the newline and double-tabs, using the Extended Searched Mode find:

\r\n\t\t

and replace with:

(blank, nothing, empty string)

And assuming you are wanting to remove the URL from the href, leaving a blank reference, you'll want to use the Regular expression Search Mode to find:

href=\"(insert-http-url-regex-here)\"

and replace with:

href=\"\"

Related Question