<?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[Regex Help Wanted - Delete all lines containing &quot;STRING&quot;]]></title><description><![CDATA[<p dir="auto">I have an output file created by program A that is then read by program B.</p>
<p dir="auto">Program A generates and appends each file with “System Tag ID-DD/MM/YYYY”, these files can be in batches of 10 -&gt; 1000</p>
<p dir="auto">Program B does not appreciate this “erroneous” data so throws a wobbly when the file is imported.</p>
<p dir="auto">I have no control over the source code for either program so cannot either of them to play nice.</p>
<p dir="auto">Using N++, how would I go about using a regex to find each line containing the string “System Tag” then deleting that line in every open file?</p>
<p dir="auto">I’ve been googling and found a few methods but none of them seem to search past the first line or return the results needed, so im obviously missing something huge</p>
<p dir="auto">for example I found this on this community but adapting it fails to find any results (?i-s)^.<em>MeX.</em>\R (It is supposed to find each line containing MeX in any case and replace the line with <em>BLANK</em> when replace is used</p>
<p dir="auto">Thank guys</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/21741/regex-help-wanted-delete-all-lines-containing-string</link><generator>RSS for Node</generator><lastBuildDate>Fri, 07 Aug 2026 21:11:07 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/21741.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 27 Aug 2021 08:59:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Regex Help Wanted - Delete all lines containing &quot;STRING&quot; on Fri, 27 Aug 2021 14:08:32 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 in <a href="/post/69330">Regex Help Wanted - Delete all lines containing "STRING"</a>:</p>
<blockquote>
<p dir="auto">(?-is)^.<em>?System Tag.</em>(\R|\z)</p>
</blockquote>
<p dir="auto">Worked flawlessly , thanks a lot folks for all your help, just saves me a whole bunch of work :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69331</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69331</guid><dc:creator><![CDATA[Gary Smith]]></dc:creator><pubDate>Fri, 27 Aug 2021 14:08:32 GMT</pubDate></item><item><title><![CDATA[Reply to Regex Help Wanted - Delete all lines containing &quot;STRING&quot; on Fri, 27 Aug 2021 14:06:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gary-smith" aria-label="Profile: Gary-Smith">@<bdi>Gary-Smith</bdi></a> said in <a href="/post/69329">Regex Help Wanted - Delete all lines containing "STRING"</a>:</p>
<blockquote>
<p dir="auto">Do you have any ideas where I could be going wrong?</p>
</blockquote>
<p dir="auto">Your last line, which is the one that has <code>System Tag</code> on it, does not have a newline sequence, so <code>\R</code> has nothing to match.  <code>(?-is)^.*?System Tag.*(\R|\z)</code> should work (see <a href="https://npp-user-manual.org/docs/searching/#anchors" rel="nofollow ugc">“Anchors” in the usermanual regex section</a>)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69330</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69330</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 27 Aug 2021 14:06:23 GMT</pubDate></item><item><title><![CDATA[Reply to Regex Help Wanted - Delete all lines containing &quot;STRING&quot; on Fri, 27 Aug 2021 14:02:12 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> Thanks for this alan, but think i’m missing something and just can’t get this to work. I have included a screenshot for the exact method im using and it still returns no results in the “replace” dialog box.</p>
<p dir="auto">Do you have any ideas where I could be going wrong?</p>
<p dir="auto"><img src="/assets/uploads/files/1630072882318-2021-08-27_15-00-07.jpg" alt="2021-08-27_15-00-07.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/69329</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69329</guid><dc:creator><![CDATA[Gary Smith]]></dc:creator><pubDate>Fri, 27 Aug 2021 14:02:12 GMT</pubDate></item><item><title><![CDATA[Reply to Regex Help Wanted - Delete all lines containing &quot;STRING&quot; on Fri, 27 Aug 2021 12:59:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/phillip-stanhope" aria-label="Profile: Phillip-Stanhope">@<bdi>Phillip-Stanhope</bdi></a> said in <a href="/post/69325">Regex Help Wanted - Delete all lines containing "STRING"</a>:</p>
<blockquote>
<p dir="auto">Can I suggest the “Sed” utility?</p>
</blockquote>
<p dir="auto">You <em>can</em>, but really people are coming here looking for solutions to problems with the solutions involving Notepad++.</p>
<p dir="auto">Directing them to non-Notepad++ utilities, when there are ways to do what they are requesting within Notepad++, is considered bad form and off-topic.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69327</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69327</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 27 Aug 2021 12:59:25 GMT</pubDate></item><item><title><![CDATA[Reply to Regex Help Wanted - Delete all lines containing &quot;STRING&quot; on Fri, 27 Aug 2021 12:18:20 GMT]]></title><description><![CDATA[<p dir="auto">Can I suggest the “Sed” utility?<br />
sed “/Regex/d” InFile &gt; OutFile<br />
“d” deletes the line containing the Regex.<br />
Alternatively : sed -i “/Regex/d” FileName  - “-i” changes the &lt;file&gt; in place.<br />
Also : sed -i -r (extended Regex)<br />
I use a .bat that requests the Input and Output file names, copies the Input file to the Output file and then does lots of substitutions.  However Sed then creates a temporary file “Sedxxx” for each command which then need deleting.<br />
If you have many files, you can create a DOS .bat file to process all files within a folder using the “FOR” command.<br />
WIndows 7, Sed for windows.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69325</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69325</guid><dc:creator><![CDATA[Phillip Stanhope]]></dc:creator><pubDate>Fri, 27 Aug 2021 12:18:20 GMT</pubDate></item><item><title><![CDATA[Reply to Regex Help Wanted - Delete all lines containing &quot;STRING&quot; on Fri, 27 Aug 2021 11:23:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gary-smith" aria-label="Profile: Gary-Smith">@<bdi>Gary-Smith</bdi></a></p>
<blockquote>
<p dir="auto">how would I go about using a regex to find each line containing the string “System Tag” then deleting that line in every open file?</p>
</blockquote>
<p dir="auto">Search for: <code>(?-is)^.*?System Tag.*\R</code> and replace with nothing.<br />
Use the <em>Replace All in All Opened Documents</em> button.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/69324</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/69324</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 27 Aug 2021 11:23:43 GMT</pubDate></item></channel></rss>