<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Delete all lines except]]></title><description><![CDATA[<p dir="auto">Here is an example of two businesses, one with an email address and one without. Each one always begins with the same code and ends with the same code so selecting for an email is easy by finding those with the @ symbol but I need to removed all lines for the 2nd example and any subsequent business listings that do not have an email address, keeping all lines for each business that does have an email address.</p>
<p dir="auto">Here’s the html code for a business listing with an email address.</p>
<p dir="auto">&lt;table align=“center” style=“width:95%;” border=“0”&gt;&lt;tr&gt;&lt;td align=‘left’ colspan=3&gt;&lt;hr style=‘border: solid 1px black;’/&gt;<br />
&lt;table align=‘left’ cellspacing=‘0’ cellpadding=‘3’ width=‘500’&gt;&lt;tr&gt;&lt;td align=‘left’ width=‘60%’ valign=‘top’&gt;<br />
&lt;font color=‘#595f75’&gt;&lt;strong&gt;A &amp; L INDUSTRIAL SERVICES&lt;/strong&gt;&lt;br&gt;Misty Martinez&lt;br&gt;&lt;/font&gt;<br />
&lt;font color=‘#595f75’&gt;2910 East P Street&lt;br&gt;Deer Park, TX  77536&lt;/font&gt;   &lt;a href=‘<a href="http://maps.google.com/?q=2910+East+P+Street%2C+Deer+Park%2C+TX+77536" rel="nofollow ugc">http://maps.google.com/?q=2910+East+P+Street%2C+Deer+Park%2C+TX+77536</a>’ target=‘_blank’ style=“color: ##228dc1;”&gt;Map&lt;/a&gt;&lt;/td&gt;<br />
&lt;td width=‘40%’ align=‘right’ valign=‘top’&gt;281 470-9805&lt;br&gt;FAX: 281 470-9899&lt;br&gt;&lt;a href=‘<a href="http://www.anlindustrial.com" rel="nofollow ugc">http://www.anlindustrial.com</a>’ target=‘_blank’&gt;&lt;font color=‘#228dc1’&gt;<a href="http://www.anlindustrial.com" rel="nofollow ugc">www.anlindustrial.com</a>&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;a href=‘<a href="mailto:misty.martinez@anlindustrial.com" rel="nofollow ugc">mailto:misty.martinez@anlindustrial.com</a>’&gt;&lt;font color=‘#228dc1’&gt;Email&lt;/font&gt;&lt;/a&gt;&lt;/td&gt;<br />
&lt;/tr&gt;&lt;tr&gt;&lt;td align=‘left’ colspan=3&gt;&lt;span style=‘font-style: italic; font-weight: bold;’&gt;<br />
&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;<br />
&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;</p>
<p dir="auto">This business does **not **have an email address so all lines for this business need to be deleted.</p>
<p dir="auto">&lt;tr&gt;&lt;td align=‘left’ colspan=3&gt;&lt;hr style=‘border: solid 1px black;’/&gt;<br />
&lt;table align=‘left’ cellspacing=‘0’ cellpadding=‘3’ width=‘500’&gt;&lt;tr&gt;&lt;td align=‘left’ width=‘60%’ valign=‘top’&gt;<br />
&lt;font color=‘#595f75’&gt;&lt;strong&gt;A Life to Live Animal Shelter &amp; Adoption Center&lt;/strong&gt;&lt;br&gt;Megan Gonzales&lt;br&gt;&lt;/font&gt;<br />
&lt;font color=‘#595f75’&gt;P.O. Box 873&lt;br&gt;Baytown, TX  77522&lt;/font&gt;&lt;/td&gt;<br />
&lt;td width=‘40%’ align=‘right’ valign=‘top’&gt;832 821-5420&lt;br&gt;&lt;a href=‘<a href="http://www.adopttosave.org" rel="nofollow ugc">http://www.adopttosave.org</a>’ target=‘_blank’&gt;&lt;font color=‘#228dc1’&gt;<a href="http://www.adopttosave.org" rel="nofollow ugc">www.adopttosave.org</a>&lt;/font&gt;&lt;/a&gt;&lt;/td&gt;<br />
&lt;/tr&gt;&lt;tr&gt;&lt;td align=‘left’ colspan=3&gt;&lt;span style=‘font-style: italic; font-weight: bold;’&gt;<br />
&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;<br />
&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;</p>
<p dir="auto">Any tips and suggestions for the correct code is appreciated. I hope to learn something so I can help others too.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/16895/delete-all-lines-except</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 02:40:45 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/16895.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 08 Jan 2019 12:42:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Delete all lines except on Wed, 09 Jan 2019 08:37:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a></p>
<blockquote>
<p dir="auto">since two of the forum’s python experts are not actively helping here anymore, I need to up my PythonScript output …</p>
</blockquote>
<p dir="auto">i really wished there was an easy way to lure both back somehow … for example with a complementary free cake for all returning members 🥧🍰🎂 :D</p>
<p dir="auto">i’ve still got the hope that someday maybe one or both will return for either historic, good times reasons, or 'cause you lured them back with future’s most ultimate py guru knowledge 👍<br />
(ps: no pressure, i think your py is already pretty good and way better than eg. mine)</p>
<p dir="auto">reader’s note:<br />
this was slightly off topic, so i give my sincere apologies to everyone in advance.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/38216</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/38216</guid><dc:creator><![CDATA[Meta Chuh]]></dc:creator><pubDate>Wed, 09 Jan 2019 08:37:47 GMT</pubDate></item><item><title><![CDATA[Reply to Delete all lines except on Wed, 09 Jan 2019 02:50:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/raymond-lee-fellers" aria-label="Profile: Raymond-Lee-Fellers">@<bdi>Raymond-Lee-Fellers</bdi></a> : glad it worked</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> : thanks for the details</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> : a negative lookahead as the <strong>start</strong> of the match segment.  No wonder I cannot store it.  I’ve bookmarked it instead.</p>
<p dir="auto">Now back to studying Python (since two of the forum’s python experts are not actively helping here anymore, I need to up my PythonScript output)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/38208</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/38208</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 09 Jan 2019 02:50:10 GMT</pubDate></item><item><title><![CDATA[Reply to Delete all lines except on Wed, 09 Jan 2019 11:06:15 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/raymond-lee-fellers" aria-label="Profile: raymond-lee-fellers">@<bdi>raymond-lee-fellers</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">First of all, <strong>Peter</strong>, I was just about to reply when I saw your <strong>solution</strong>. My solution is quite <strong>similar</strong> and just a bit <strong>less accurate</strong> than your one, as my <strong>opening</strong> boundary is simply <strong><code>&lt;tr&gt;&lt;td align='left' !</code></strong>   !</p>
<p dir="auto">I’ve found the regex : <strong><code>(?s)&lt;tr&gt;&lt;td align='left'[^@]+&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;\R</code></strong></p>
<hr />
<p dir="auto">Regarding your question, <strong>Peter</strong>, the <strong>right</strong> answer is the <strong>Alan</strong>’s one ! So, if you’re looking for the <strong>smallest</strong> area of characters, even on <strong>several</strong> lines, between the <strong>opening</strong> boundary <strong><code>START</code></strong> and the <strong>ending</strong> boundary <strong><code>END</code></strong>, in that <strong>exact</strong> case, which should <strong>not</strong> contain, for instance, the number <strong><code>123</code></strong>, the correct regex is :</p>
<p dir="auto"><strong><code>(?s-i)START((?!123).)*?END</code></strong></p>
<p dir="auto">Indeed, this regex means that, before <strong>each</strong> position reached by the regex engine, after the word <strong>START</strong>, it tests the <strong>negative look-ahead</strong>, i.e. it asks : On the <strong>next three</strong> characters, is there a <strong><code>123</code></strong> string ? If NOT, the <strong>negative</strong> look-ahead is TRUE and, then, allows the regex engine to <strong>continue</strong> the process and to move to the <strong>next</strong> character</p>
<hr />
<p dir="auto">Of course, if you want to select this <strong>same</strong> area of characters, which <strong>does</strong> contain the number <strong><code>123</code></strong>, this regex is simply :</p>
<p dir="auto"><strong><code>(?s-i)START.*?123.*?END</code></strong></p>
<p dir="auto">Test it, against the text, below :</p>
<pre><code class="language-diff">......START123......................END................START123......................END..........
......START.........................END................START.........................END..........
......START...........1.............END................START...........1.............END..........
......START............2............END................START............2............END..........
......START.............3...........END................START.............3...........END..........
......START...........123...........END................START...........123...........END..........
......START...........12............END................START...........12............END..........
......START............23...........END................START............23...........END..........
......START...........1.3...........END................START...........1.3...........END..........
......START......................123END................START......................123END..........
</code></pre>
<p dir="auto">You’ve certainly noticed that, if you look for areas, containing the <strong><code>123</code></strong> number, in my <strong>sample</strong> text, the <strong>best</strong> is to use the regex <strong><code>(?-is)START.*?123.*?END</code></strong>, which limit to a <strong>single</strong>-line range ;-))</p>
<p dir="auto">Best regards,</p>
<p dir="auto">guy038</p>
<p dir="auto"><strong>P.S.</strong> :</p>
<p dir="auto">Note that the regex <strong><code>(?s-i)START((?!123).)*?END</code></strong> could be rewritten, in a <strong>complicated</strong> way;, as :</p>
<p dir="auto"><strong><code>(?s-i)START(((?!1)|(?=1(?!2))|(?=12(?!3))).)*?END</code></strong></p>
<p dir="auto">Just the use of the <strong>Boole algebra</strong> !. Indeed, if we consider <strong><code>3</code> consecutive</strong> chars, in order to match <strong>all</strong> cases <strong>different</strong> of number “<strong>123</strong>”, we may use :</p>
<pre><code class="language-diff">NOT (123) = NOT 1 OR ( 1 AND NOT 2 ) OR ( 12 AND NOT 3 ) 
             V             V                  V
            ...           1..                12.
            .2.           1.3
            ..3
            .23
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/38207</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/38207</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 09 Jan 2019 11:06:15 GMT</pubDate></item><item><title><![CDATA[Reply to Delete all lines except on Tue, 08 Jan 2019 22:47:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said:</p>
<blockquote>
<p dir="auto">(?s)&lt;tr&gt;&lt;td align=‘left’ colspan=3&gt;&lt;hr style=‘border: solid 1px black;’/&gt;[^@]*?&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;</p>
</blockquote>
<p dir="auto">Works perfectly. Didn’t have to fix anything. Your code works out of the box. Thank you.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/38203</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/38203</guid><dc:creator><![CDATA[Raymond Lee Fellers]]></dc:creator><pubDate>Tue, 08 Jan 2019 22:47:38 GMT</pubDate></item><item><title><![CDATA[Reply to Delete all lines except on Tue, 08 Jan 2019 22:19:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/raymond-lee-fellers" aria-label="Profile: Raymond-Lee-Fellers">@<bdi>Raymond-Lee-Fellers</bdi></a></p>
<p dir="auto">No problem…helping you out is the most important thing.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a></p>
<p dir="auto">This may be the idiom you seek?:</p>
<p dir="auto"><code>((?!mailto:).)*</code></p>
<p dir="auto">It is not the easiest thing to remember.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/38201</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/38201</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 08 Jan 2019 22:19:32 GMT</pubDate></item><item><title><![CDATA[Reply to Delete all lines except on Tue, 08 Jan 2019 22:16:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a>  oops, you’re right. The 1st example is different from the second one; however it appears that all subsequent blocks do begin and end with the same code. My apologies.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/38200</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/38200</guid><dc:creator><![CDATA[Raymond Lee Fellers]]></dc:creator><pubDate>Tue, 08 Jan 2019 22:16:23 GMT</pubDate></item><item><title><![CDATA[Reply to Delete all lines except on Tue, 08 Jan 2019 21:44:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a>,</p>
<p dir="auto">For my own curiosity (one of these days, I want this idiom to stick): starting with my FIND = <code>(?s)\R*&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;hr style='border: solid 1px black;'/&gt;[^@]*?&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;\R*</code> as the baseline, how would you fix <code>[^@]*?</code> to search for "any non-greedy sequence of characters that does not contain <code>mailto:</code> " instead of “any non-greedy sequence of characters that does not contain an <code>@</code> sign”</p>
]]></description><link>https://community.notepad-plus-plus.org/post/38198</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/38198</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 08 Jan 2019 21:44:19 GMT</pubDate></item><item><title><![CDATA[Reply to Delete all lines except on Tue, 08 Jan 2019 21:39:49 GMT]]></title><description><![CDATA[<p dir="auto">Given that it’s the probably the forum itself that clobbered the real quotes into smart quotes, and the little “?” isn’t super-obvious, being light grey and pretty small and a one-character-wide click, I’m willing to fix smartquotes for first-time posters (and since in his first thread, no one pointed out to Raymond how to properly format in these forums, I gave an extension).</p>
<p dir="auto">But now that I’ve explained it, and pointed out multiple times to <a class="plugin-mentions-user plugin-mentions-a" href="/user/raymond-lee-fellers" aria-label="Profile: Raymond-Lee-Fellers">@<bdi>Raymond-Lee-Fellers</bdi></a> that he needs to apply Markdown formatting to force the blocks to be rendered unedited, I will expect any further clarifications or posts from him to be formatted better</p>
]]></description><link>https://community.notepad-plus-plus.org/post/38197</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/38197</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 08 Jan 2019 21:39:49 GMT</pubDate></item><item><title><![CDATA[Reply to Delete all lines except on Tue, 08 Jan 2019 21:34:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said:</p>
<blockquote>
<p dir="auto">well, if you fix smartquotes, assume nothing else was markdown-ed away, and ignore the initial</p>
</blockquote>
<p dir="auto">Or better yet, you fix nothing, and just…move…on…</p>
<p dir="auto">It is actually amazing the number of people here that make you want to figure out what they are trying to ask before you give them help.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/38195</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/38195</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 08 Jan 2019 21:34:08 GMT</pubDate></item><item><title><![CDATA[Reply to Delete all lines except on Tue, 08 Jan 2019 21:32:14 GMT]]></title><description><![CDATA[<p dir="auto">too slow for another edit: if you prefix and suffix the FIND string with <code>\R*</code>, you can get rid of the blank lines, too:</p>
<ul>
<li>FIND = <code>(?s)\R*&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;hr style='border: solid 1px black;'/&gt;[^@]*?&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;\R*</code></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/38194</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/38194</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 08 Jan 2019 21:32:14 GMT</pubDate></item><item><title><![CDATA[Reply to Delete all lines except on Tue, 08 Jan 2019 21:30:13 GMT]]></title><description><![CDATA[<p dir="auto">Wait, when I say it that way, it was easier than I thought.  Assuming the <code>@</code> sign is sufficient to mark it as having an email, then the following should work to find and delete the ones without an email:</p>
<ul>
<li>REGULAR EXPRESSION mode</li>
<li>FIND = <code>(?s)&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;hr style='border: solid 1px black;'/&gt;[^@]*?&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;</code></li>
<li>REPLACE = `` (empty)</li>
</ul>
<p dir="auto">If you need a longer string than just the <code>@</code> to determine that it’s got an email, then I defer to Guy.</p>
<p dir="auto"><strong>edit</strong>: yes, when I run it on:</p>
<pre><code>&lt;table align="center" style="width:95%;" border="0"&gt;&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;hr style='border: solid 1px black;'/&gt;
&lt;table align='left' cellspacing='0' cellpadding='3' width='500'&gt;&lt;tr&gt;&lt;td align='left' width='60%' valign='top'&gt;
&lt;font color='#595f75'&gt;&lt;strong&gt;A &amp; L INDUSTRIAL SERVICES&lt;/strong&gt;&lt;br&gt;Misty Martinez&lt;br&gt;&lt;/font&gt;
&lt;font color='#595f75'&gt;2910 East P Street&lt;br&gt;Deer Park, TX 77536&lt;/font&gt;   &lt;a href='http://maps.google.com/?q=2910+East+P+Street%2C+Deer+Park%2C+TX+77536' target='_blank' style="color: ##228dc1;"&gt;Map&lt;/a&gt;&lt;/td&gt;
&lt;td width='40%' align='right' valign='top'&gt;281 470-9805&lt;br&gt;FAX: 281 470-9899&lt;br&gt;&lt;a href='http://www.anlindustrial.com' target='_blank'&gt;&lt;font color='#228dc1'&gt;www.anlindustrial.com&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;a href='mailto:misty.martinez@anlindustrial.com'&gt;&lt;font color='#228dc1'&gt;Email&lt;/font&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;span style='font-style: italic; font-weight: bold;'&gt;
&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;hr style='border: solid 1px black;'/&gt;
&lt;table align='left' cellspacing='0' cellpadding='3' width='500'&gt;&lt;tr&gt;&lt;td align='left' width='60%' valign='top'&gt;
&lt;font color='#595f75'&gt;&lt;strong&gt;A Life to Live Animal Shelter &amp; Adoption Center&lt;/strong&gt;&lt;br&gt;Megan Gonzales&lt;br&gt;&lt;/font&gt;
&lt;font color='#595f75'&gt;P.O. Box 873&lt;br&gt;Baytown, TX 77522&lt;/font&gt;&lt;/td&gt;
&lt;td width='40%' align='right' valign='top'&gt;832 821-5420&lt;br&gt;&lt;a href='http://www.adopttosave.org' target='_blank'&gt;&lt;font color='#228dc1'&gt;www.adopttosave.org&lt;/font&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;span style='font-style: italic; font-weight: bold;'&gt;
&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;hr style='border: solid 1px black;'/&gt;
&lt;table align='left' cellspacing='0' cellpadding='3' width='500'&gt;&lt;tr&gt;&lt;td align='left' width='60%' valign='top'&gt;
&lt;font color='#595f75'&gt;&lt;strong&gt;A &amp; L INDUSTRIAL SERVICES&lt;/strong&gt;&lt;br&gt;Misty Martinez&lt;br&gt;&lt;/font&gt;
&lt;font color='#595f75'&gt;2910 East P Street&lt;br&gt;Deer Park, TX 77536&lt;/font&gt;   &lt;a href='http://maps.google.com/?q=2910+East+P+Street%2C+Deer+Park%2C+TX+77536' target='_blank' style="color: ##228dc1;"&gt;Map&lt;/a&gt;&lt;/td&gt;
&lt;td width='40%' align='right' valign='top'&gt;281 470-9805&lt;br&gt;FAX: 281 470-9899&lt;br&gt;&lt;a href='http://www.anlindustrial.com' target='_blank'&gt;&lt;font color='#228dc1'&gt;www.anlindustrial.com&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;a href='mailto:misty.martinez@anlindustrial.com'&gt;&lt;font color='#228dc1'&gt;Email&lt;/font&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;span style='font-style: italic; font-weight: bold;'&gt;
&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;hr style='border: solid 1px black;'/&gt;
&lt;table align='left' cellspacing='0' cellpadding='3' width='500'&gt;&lt;tr&gt;&lt;td align='left' width='60%' valign='top'&gt;
&lt;font color='#595f75'&gt;&lt;strong&gt;A &amp; L INDUSTRIAL SERVICES&lt;/strong&gt;&lt;br&gt;Misty Martinez&lt;br&gt;&lt;/font&gt;
&lt;font color='#595f75'&gt;2910 East P Street&lt;br&gt;Deer Park, TX 77536&lt;/font&gt;   &lt;a href='http://maps.google.com/?q=2910+East+P+Street%2C+Deer+Park%2C+TX+77536' target='_blank' style="color: ##228dc1;"&gt;Map&lt;/a&gt;&lt;/td&gt;
&lt;td width='40%' align='right' valign='top'&gt;281 470-9805&lt;br&gt;FAX: 281 470-9899&lt;br&gt;&lt;a href='http://www.anlindustrial.com' target='_blank'&gt;&lt;font color='#228dc1'&gt;www.anlindustrial.com&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;a href='mailto:misty.martinez@anlindustrial.com'&gt;&lt;font color='#228dc1'&gt;Email&lt;/font&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;span style='font-style: italic; font-weight: bold;'&gt;
&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;hr style='border: solid 1px black;'/&gt;
&lt;table align='left' cellspacing='0' cellpadding='3' width='500'&gt;&lt;tr&gt;&lt;td align='left' width='60%' valign='top'&gt;
&lt;font color='#595f75'&gt;&lt;strong&gt;A Life to Live Animal Shelter &amp; Adoption Center&lt;/strong&gt;&lt;br&gt;Megan Gonzales&lt;br&gt;&lt;/font&gt;
&lt;font color='#595f75'&gt;P.O. Box 873&lt;br&gt;Baytown, TX 77522&lt;/font&gt;&lt;/td&gt;
&lt;td width='40%' align='right' valign='top'&gt;832 821-5420&lt;br&gt;&lt;a href='http://www.adopttosave.org' target='_blank'&gt;&lt;font color='#228dc1'&gt;www.adopttosave.org&lt;/font&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;span style='font-style: italic; font-weight: bold;'&gt;
&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;hr style='border: solid 1px black;'/&gt;
&lt;table align='left' cellspacing='0' cellpadding='3' width='500'&gt;&lt;tr&gt;&lt;td align='left' width='60%' valign='top'&gt;
&lt;font color='#595f75'&gt;&lt;strong&gt;A Life to Live Animal Shelter &amp; Adoption Center&lt;/strong&gt;&lt;br&gt;Megan Gonzales&lt;br&gt;&lt;/font&gt;
&lt;font color='#595f75'&gt;P.O. Box 873&lt;br&gt;Baytown, TX 77522&lt;/font&gt;&lt;/td&gt;
&lt;td width='40%' align='right' valign='top'&gt;832 821-5420&lt;br&gt;&lt;a href='http://www.adopttosave.org' target='_blank'&gt;&lt;font color='#228dc1'&gt;www.adopttosave.org&lt;/font&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;span style='font-style: italic; font-weight: bold;'&gt;
&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
</code></pre>
<p dir="auto">I get</p>
<pre><code> &lt;table align="center" style="width:95%;" border="0"&gt;&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;hr style='border: solid 1px black;'/&gt;
&lt;table align='left' cellspacing='0' cellpadding='3' width='500'&gt;&lt;tr&gt;&lt;td align='left' width='60%' valign='top'&gt;
&lt;font color='#595f75'&gt;&lt;strong&gt;A &amp; L INDUSTRIAL SERVICES&lt;/strong&gt;&lt;br&gt;Misty Martinez&lt;br&gt;&lt;/font&gt;
&lt;font color='#595f75'&gt;2910 East P Street&lt;br&gt;Deer Park, TX 77536&lt;/font&gt;   &lt;a href='http://maps.google.com/?q=2910+East+P+Street%2C+Deer+Park%2C+TX+77536' target='_blank' style="color: ##228dc1;"&gt;Map&lt;/a&gt;&lt;/td&gt;
&lt;td width='40%' align='right' valign='top'&gt;281 470-9805&lt;br&gt;FAX: 281 470-9899&lt;br&gt;&lt;a href='http://www.anlindustrial.com' target='_blank'&gt;&lt;font color='#228dc1'&gt;www.anlindustrial.com&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;a href='mailto:misty.martinez@anlindustrial.com'&gt;&lt;font color='#228dc1'&gt;Email&lt;/font&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;span style='font-style: italic; font-weight: bold;'&gt;
&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;hr style='border: solid 1px black;'/&gt;
&lt;table align='left' cellspacing='0' cellpadding='3' width='500'&gt;&lt;tr&gt;&lt;td align='left' width='60%' valign='top'&gt;
&lt;font color='#595f75'&gt;&lt;strong&gt;A &amp; L INDUSTRIAL SERVICES&lt;/strong&gt;&lt;br&gt;Misty Martinez&lt;br&gt;&lt;/font&gt;
&lt;font color='#595f75'&gt;2910 East P Street&lt;br&gt;Deer Park, TX 77536&lt;/font&gt;   &lt;a href='http://maps.google.com/?q=2910+East+P+Street%2C+Deer+Park%2C+TX+77536' target='_blank' style="color: ##228dc1;"&gt;Map&lt;/a&gt;&lt;/td&gt;
&lt;td width='40%' align='right' valign='top'&gt;281 470-9805&lt;br&gt;FAX: 281 470-9899&lt;br&gt;&lt;a href='http://www.anlindustrial.com' target='_blank'&gt;&lt;font color='#228dc1'&gt;www.anlindustrial.com&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;a href='mailto:misty.martinez@anlindustrial.com'&gt;&lt;font color='#228dc1'&gt;Email&lt;/font&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;span style='font-style: italic; font-weight: bold;'&gt;
&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;hr style='border: solid 1px black;'/&gt;
&lt;table align='left' cellspacing='0' cellpadding='3' width='500'&gt;&lt;tr&gt;&lt;td align='left' width='60%' valign='top'&gt;
&lt;font color='#595f75'&gt;&lt;strong&gt;A &amp; L INDUSTRIAL SERVICES&lt;/strong&gt;&lt;br&gt;Misty Martinez&lt;br&gt;&lt;/font&gt;
&lt;font color='#595f75'&gt;2910 East P Street&lt;br&gt;Deer Park, TX 77536&lt;/font&gt;   &lt;a href='http://maps.google.com/?q=2910+East+P+Street%2C+Deer+Park%2C+TX+77536' target='_blank' style="color: ##228dc1;"&gt;Map&lt;/a&gt;&lt;/td&gt;
&lt;td width='40%' align='right' valign='top'&gt;281 470-9805&lt;br&gt;FAX: 281 470-9899&lt;br&gt;&lt;a href='http://www.anlindustrial.com' target='_blank'&gt;&lt;font color='#228dc1'&gt;www.anlindustrial.com&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;a href='mailto:misty.martinez@anlindustrial.com'&gt;&lt;font color='#228dc1'&gt;Email&lt;/font&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;span style='font-style: italic; font-weight: bold;'&gt;
&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;


&lt;/table&gt;
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/38193</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/38193</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 08 Jan 2019 21:30:13 GMT</pubDate></item><item><title><![CDATA[Reply to Delete all lines except on Tue, 08 Jan 2019 21:24:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> , well, if you fix smartquotes, assume nothing else was markdown-ed away, and ignore the initial <code>&lt;table align="center" style="width:95%;" border="0"&gt;</code>, then both blocks start with <code>&lt;tr&gt;&lt;td align='left' colspan=3&gt;&lt;hr style='border: solid 1px black;'/&gt;</code> and end with <code>&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;</code>.</p>
<p dir="auto">I am just not good enough with finding long strings that <em>don’t</em> contain a specific subsequence to be able to come up with one that will work.  But I see <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> is browsing this topic now, so I assume magic regex will soon be appearing…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/38192</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/38192</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 08 Jan 2019 21:24:04 GMT</pubDate></item><item><title><![CDATA[Reply to Delete all lines except on Tue, 08 Jan 2019 19:55:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/raymond-lee-fellers" aria-label="Profile: Raymond-Lee-Fellers">@<bdi>Raymond-Lee-Fellers</bdi></a> said:</p>
<blockquote>
<p dir="auto">since every block of code begins and ends with the exact same code</p>
</blockquote>
<p dir="auto">Well, in your example above this is NOT the case (the 2 cases don’t start out the same way, although they do end the same way).  One could guess at what is missing, but you seem so sure it is all there.  Unless I am just not seeing it somehow.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/38190</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/38190</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 08 Jan 2019 19:55:37 GMT</pubDate></item><item><title><![CDATA[Reply to Delete all lines except on Tue, 08 Jan 2019 19:46:47 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for taking the time for your extensive help. Many sites that allow posting of html provide a way to isolate the code so it is recognized as such but I did not see that option here.</p>
<p dir="auto">I thought this would not be too difficult a problem to solve since every block of code begins and ends with the exact same code in this case and the exceptions I want to keep all will have the @ symbol somewhere in that block of code if there is an email address. If there is no @ symbol then all code between the start and end code would be deleted. How is that different than finding a single line and deleting it?</p>
<p dir="auto">Regardless I will follow you advice and try to structure my question better.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/38188</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/38188</guid><dc:creator><![CDATA[Raymond Lee Fellers]]></dc:creator><pubDate>Tue, 08 Jan 2019 19:46:47 GMT</pubDate></item><item><title><![CDATA[Reply to Delete all lines except on Tue, 08 Jan 2019 14:49:09 GMT]]></title><description><![CDATA[<p dir="auto">There is probably a way to generate a regular expression that will do what you want – <a href="https://notepad-plus-plus.org/community/topic/15765/faq-desk-where-to-find-regex-documentation" rel="nofollow ugc">this FAQ</a> will give a good starting place for understanding regular expressions for fancy search/replace/delete actions.</p>
<p dir="auto">But it’s going to be really hard to craft accurately – though there are a couple here who will probably try, even based on your limited examples – because of all the nestings and balances that need to be checked to ensure that the regex doesn’t delete multiple entries instead of just one, and doesn’t go from the middle of one to the middle of another.  (Regular expressions are not well-suited for parsing HTML/XML and the like.  You can sometimes do it for a limited circumstance, but it’s not a very general solution.)</p>
<p dir="auto">If you really just had a few, I would just do it manually.  But if you have an HTML file with large numbers of entries, I can see why you would want to automate the problem: I’m just not convinced that a regular expression from within Notepad++ is really the best plan.  Especially if in another day or week or month, you’re going to want to do something similar, but with a tweaked requirement.</p>
<p dir="auto">However, if you have an HTML file with a large number of entries, I somehow doubt it was originally generated manually in a text editor. My guess is that it came from a database.  If you have access to the original program/website-backend/whatever that generated the HTML originally (or can contact a person who has access), it would be much easier to filter the data <em>before</em> it makes it into the HTML to begin with – and to regenerate the HTML from the source data, rather that post-processing.</p>
<p dir="auto">If you are in the unfortunately circumstance where the HTML was generated “a long time ago”, and whoever or whatever generated the HTML is lost or gone or otherwise no longer available, I’m still not sure Notepad++ with regular expressions are your best option, especially if you are going to have to filter the data more than once in your life (the regex would have to be re-worked for every slight variation in what you wanted to filter, and tweaking the regex might be more maintenance hassle than the time it saves by eliminating the manual edit.  Most programming languages – especially so called “scripting” languages, like Perl, Python, or Lua, which are languages designed for having fast development times to solve problems like this – have libraries/modules/packages available which can easily parse HTML and extract the data; once it’s parsed, it’s easily filtered, and then the remaining HTML can be spit back out – or, even better, the underlying data could be put into a new database, and then a script could be used to extract filtered data from that database to generate the HTML.</p>
<p dir="auto">If you have no access to the original generator of the HTML, and if you don’t have the programming skills (and no one else in your organization does, either) to extract and filter, then maybe a regex supplied by friendly helpers in this forum is your next remaining option.  In which case, please help us help you.</p>
<ol>
<li>
<p dir="auto">Repost the data in this forum in a way that will not mess up the data: right now, all your single and double quote marks are “smart quotes”, and those aren’t valid HTML, so I am assuming that the forum “kindly” converted your data.  There may be other markdown characters that get eliminated as well, that we cannot begin to guess at.  The “?” next to the COMPOSE in the post-editing window will direct you to a help page for markdown formatting.  Or <a href="https://notepad-plus-plus.org/community/topic/14262/how-to-markdown-code-on-this-forum/2" rel="nofollow ugc">this help-with-markdown post</a> will show details of good ways to use it in the forum.  But in short, to quote a block of text verbatim, you can either put blank lines before and after, and indent every line of the quote by 4 spaces or a tab (this can easily be done by putting the raw text in Notepad++, selecting it all, hitting TAB, COPY that selected-and-indented data, and pasting in the forum) – it will show up in a black text block in the PREVIEW pane to the right of the EDIT pane.  Or, if you are worried about “editing” the raw data even that much, format it like:</p>
<pre><code>  
 ```z
 &lt;table&gt;&lt;tr&gt;...
 ...&lt;/tr&gt;&lt;/table&gt;
 ```
  
</code></pre>
<p dir="auto">Where you put a blank line, then <code> ```z</code>, then the raw data, then <code>```</code>, then a blank line.  This will render like</p>
<pre><code class="language-z">&lt;table&gt;&lt;tr&gt;...
...&lt;/tr&gt;&lt;/table&gt;
</code></pre>
</li>
<li>
<p dir="auto">Include more examples of both data that will stay and data that will be deleted; often times, it’s the things that <em>don’t</em> get edited that give more clues as to how to craft the regex than what <em>does</em> get edited.</p>
</li>
<li>
<p dir="auto">If there is always some other separator HTML (which you have not shown), it might make it easier to define the beginning and ending of an entry based on that separator.</p>
</li>
</ol>
]]></description><link>https://community.notepad-plus-plus.org/post/38162</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/38162</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 08 Jan 2019 14:49:09 GMT</pubDate></item></channel></rss>