Is there a way to replace the whole paragraph in Notepad ++

I am trying to replace in Notepad ++, using the Replace module, the bottom paragraph in html (I have 30 html files and you need to replace them in all of them)

<script type="text/javascript"> <!-- var slideInterval=20000; var slideTransition=3500; var slideArray=["/background1.jpg","background2.jpg"]; jQuery.fx.interval=33; // --> </script> 

But Notepad ++ does not allow me to replace unless it is a line instead of a paragraph, and if I put everything on one line for replacement, I will have other problems that I can worry about in my html. Hope you have some work on this.

+5
source share
2 answers

I found a good way to use multi-line find or replace. I simply copied this paragraph into the Ctrl+H "find" field, then added another paragraph and pasted it into the "replace" field. Notepad ++ will show a tabbed space that means line break. And voila, you can "Replace in all open documents" with just one click.

NB: the operation "copy" must be in Notepad ++, otherwise it inserts only the first row in both fields.

Update: To clarify my answer, I found out that Notepad ++ will only allow me to Paste once. This means that if I copy the paragraph, I can paste it with its line break in the "find" field, but if I paste it again in the replace field, it will only insert the first line. Therefore, in the Cntrl + H field, no more than 1 โ€œinsertโ€ operation is allowed if I want to โ€œinsertโ€ a line break.

So for this to be done, first select any text that I want and CNTR+C on it, then to find the paragraph, I just โ€œSelect itโ€ and press Cntrl + H : Notepad ++ automatically displays the already selected text in Find field. Secondly, we "paste" the text, which is already in our clipboard, into the "Replace" field. And line breaks are here!

In short: select text โ†’ Cntrl+C โ†’ Select text โ†’ Cntrl+H โ†’ Cntrl+V in the โ€œreplaceโ€ field

+4
source

I think I found a guide that describes what you are looking for. The author has examples and results, and some multi-line replacements are included. You should be able to extrapolate what it does for several files by clicking "Replace all in all open documents."

http://markantoniou.blogspot.com/2008/06/notepad-how-to-use-regular-expressions.html

+1
source

Source: https://habr.com/ru/post/1209728/


All Articles