<?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: Mark/Delete the 2 second line after some word]]></title><description><![CDATA[<p dir="auto">hello everyone. I need to mark/delete the 2 second line after some word. For exemple:</p>
<p dir="auto"><code>1.line</code><br />
<code>2.line</code><br />
<code>3.bla bla bla WORD_1 bla bla</code><br />
<code>4.line</code><br />
<code>5.line</code><br />
<code>6.line ETC</code></p>
<p dir="auto">So, I want to delete the line that contains WORD_1 and the next 2 lines (but without line 6). Can anyone help me?</p>
<p dir="auto">I try this regex, this will delete the line with WORD_1, but will not delete line 4 and 5. But will insert another line 4 instead delete.</p>
<p dir="auto">Search:<br />
<code>^.*WORD_1.*$</code><br />
Replace by:<br />
<code>\n\n</code></p>
]]></description><link>https://community.notepad-plus-plus.org/topic/12994/regex-mark-delete-the-2-second-line-after-some-word</link><generator>RSS for Node</generator><lastBuildDate>Sun, 11 Oct 2026 17:33:57 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/12994.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 29 Dec 2016 14:57:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to REGEX: Mark/Delete the 2 second line after some word on Thu, 29 Dec 2016 18:58:20 GMT]]></title><description><![CDATA[<p dir="auto">well, guy38, nice present for me.</p>
<p dir="auto">thanks a lot !</p>
<p dir="auto">This is for you !</p>
<p dir="auto"><a href="https://www.youtube.com/watch?v=nPW5nfoIYf8" rel="nofollow ugc">https://www.youtube.com/watch?v=nPW5nfoIYf8</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/20376</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/20376</guid><dc:creator><![CDATA[Vasile Caraus]]></dc:creator><pubDate>Thu, 29 Dec 2016 18:58:20 GMT</pubDate></item><item><title><![CDATA[Reply to REGEX: Mark/Delete the 2 second line after some word on Thu, 29 Dec 2016 16:33:54 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <strong>Vasile</strong>,</p>
<p dir="auto">Not difficult, indeed !</p>
<p dir="auto">The <strong>general</strong> regex S/R, which <strong>deletes</strong> ANY line, containing a <strong>SPECIFIC</strong> word, with <strong>generic</strong> name = <strong>WORD</strong>, along with the <strong>N</strong> lines, <strong>following</strong> this line, is :</p>
<p dir="auto">SEARCH <strong><code>(?-s)^.*WORD.*\R(.*\R){N}</code></strong></p>
<p dir="auto">REPLACE <strong><code>EMPTY</code></strong></p>
<p dir="auto">So, in your case, the <strong>search</strong> regex should be <strong><code>(?-s)^.*WORD_1.*\R(.*\R){2}</code></strong></p>
<hr />
<p dir="auto">In the same way, the <strong>general</strong> regex S/R, below, which would delete <strong>ANY</strong> line, containing the word <strong>WORD</strong> and the <strong>N</strong> lines located <strong>BEFORE</strong> this line, is :</p>
<p dir="auto">SEARCH <strong><code>(?-s)(.*\R){N}.*WORD.*\R</code></strong></p>
<p dir="auto">REPLACE <strong><code>EMPTY</code></strong></p>
<hr />
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">Due to the <strong><code>(?-s)</code></strong> modifier, the <strong>dot</strong>, <strong><code>.</code></strong>, stands for a <strong>single standard</strong> character, only</p>
</li>
<li>
<p dir="auto">As usual, the <strong><code>\R</code></strong>  syntax matches <strong>any</strong> kind of <strong>Line Break</strong>   ( <strong><code>\r\n</code></strong> in <strong>Windows</strong> files, <strong><code>\n</code></strong> in <strong>Unix</strong> files or <strong><code>\r</code></strong> in <strong>old Mac</strong> files )</p>
</li>
<li>
<p dir="auto">The part <strong><code>.*\R</code></strong> represents a <strong>complete</strong> line, even <strong>empty</strong>, with its <strong>EOL</strong> character(s)</p>
</li>
<li>
<p dir="auto">So the syntax <strong><code>(.*\R){N}</code></strong>, where N is an <strong>integer</strong>, stands <strong>N complete</strong> lines</p>
</li>
</ul>
<p dir="auto">Best Regards</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/20372</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/20372</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 29 Dec 2016 16:33:54 GMT</pubDate></item></channel></rss>