Delete all lines until a specific line in Notepad++

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

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

What I want to do is to delete lines until table tag. I think I can do it with Regex search but I couldnt write the regex pattern. Thank you


You have to go through multiple steps to do what you stated above:

  1. Go to the replace window, select the "extended" mode, and in the "find what" field type in "\r\n" and replace them with: "LINEBREAK" (theres a space after 'LINEBREAK'). Click on replace all.

  2. Go to the replace window again, select the "regular expression" mode, and in the "find what" field type in "(.*)(.*)(<table)(.*)(>)(.*)(.*)" and in the replace with field, type in "\2\3\4\5". Click on replace all.

  3. Now go to replace window again, select elect the "extended" mode, and in the "find what" field type in "LINEBREAK" (theres a space after 'LINEBREAK') and replace them with: "\r\n". Click on replace all.

Notepad++ doesn't support multi line regex, which makes it hard to do what you wanted to do without going through the steps given above.

Need Your Help

image segmentation (by graphcut & maxflow) seeds are incorrently labeld

algorithm image-segmentation

I have implemented a graphcut algorithm (based on maxflow) for image segmentation (the same idea of Lazysnapping). The algorithm inputs the image and some seeds (both foreground and background). Ev...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.