Delete all lines to a specific line in Notepad ++

I need to edit a lot of source codes similar to each other.

random blah
 random blah
blah
<table style="width: 232px; font-size: small;" cellpadding="0" cellspacing="0">....

What I want to do is delete the rows before the table tag. I think I can do this with a search in Regex, but I could not write a regex pattern. Thanks you

+3
source share
2 answers

You need to go through several steps to do what you indicated above:

  • Go to the replacement window, select the "advanced" mode and enter the "Find that" field in the " \r\n" and replace them with " LINEBREAK" (this is the space after the 'LINE SPLIT'). Click to replace everything.

  • , " " " " "(.*)(.*)(<table)(.*)(>)(.*)(.*)", "" "\2\3\4\5". , .

  • , , "" , " " "LINEBREAK" ( "LINEBREAK" ) : "\r\n". , .

Notepad ++ , , , , .

+3

- :

(^.*$\n)*<table(.+)>

%)

0
source

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


All Articles