<?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[adding word between any 3 lines]]></title><description><![CDATA[<p dir="auto">Hi, Happy New Year<br />
I have text file like this:</p>
<pre><code>aaaaaaaaaaaa
bbbbbbbbbbbb
cccccccccccc
dddddddddddd
eeeeeeeeeeee
ffffffffffff
gggggggggggg
hhhhhhhhhhhh
iiiiiiiiiiii
jjjjjjjjjjjj
kkkkkkkkkkkk
llllllllllll
mmmmmmmmmmmm
nnnnnnnnnnnn
oooooooooooo
pppppppppppp
qqqqqqqqqqqq
</code></pre>
<p dir="auto">And i want to add a word/code between any 3 lines,<br />
How can i do this:</p>
<pre><code>[word]aaaaaaaaaaaa
bbbbbbbbbbbb
cccccccccccc
[word]dddddddddddd
eeeeeeeeeeee
ffffffffffff
[word]gggggggggggg
hhhhhhhhhhhh
iiiiiiiiiiii
[word]jjjjjjjjjjjj
kkkkkkkkkkkk
llllllllllll
[word]mmmmmmmmmmmm
nnnnnnnnnnnn
oooooooooooo
[word]pppppppppppp
qqqqqqqqqqqq
</code></pre>
<p dir="auto">This one is also ok:</p>
<pre><code>[word]
aaaaaaaaaaaa
bbbbbbbbbbbb
cccccccccccc
[word]
dddddddddddd
eeeeeeeeeeee
ffffffffffff
[word]
gggggggggggg
hhhhhhhhhhhh
iiiiiiiiiiii
[word]
jjjjjjjjjjjj
kkkkkkkkkkkk
llllllllllll
[word]
mmmmmmmmmmmm
nnnnnnnnnnnn
oooooooooooo
[word]
pppppppppppp
qqqqqqqqqqqq
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/topic/18724/adding-word-between-any-3-lines</link><generator>RSS for Node</generator><lastBuildDate>Thu, 18 Jun 2026 13:35:43 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/18724.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 06 Jan 2020 16:02:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to adding word between any 3 lines on Tue, 07 Jan 2020 10:58:49 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/hasan123" aria-label="Profile: Hasan123">@<bdi>Hasan123</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-kilborn">@<bdi>Alan-kilborn</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Here is my <strong>very similar</strong> version :</p>
<p dir="auto">SEARCH <strong><code>(?-s)(?:^.+(?:(\R)|\Z)){1,3}</code></strong></p>
<p dir="auto"><strong><code>[word]\1$0</code></strong></p>
<p dir="auto"><strong>Group <code>\1</code></strong> contains the current <strong>EOL</strong> char(s) of the file</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49708</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49708</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 07 Jan 2020 10:58:49 GMT</pubDate></item><item><title><![CDATA[Reply to adding word between any 3 lines on Mon, 06 Jan 2020 18:36:08 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> said in <a href="/post/49688">adding word between any 3 lines</a>:</p>
<blockquote>
<p dir="auto">I would try searching for <code>(?-s)^(?:.*\R){3}</code> and replacing with <code>[word]$0</code>.  Search mode = Regular expression</p>
</blockquote>
<p dir="auto">Thank you very much, it’s do the job for me :)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49694</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49694</guid><dc:creator><![CDATA[hasan123]]></dc:creator><pubDate>Mon, 06 Jan 2020 18:36:08 GMT</pubDate></item><item><title><![CDATA[Reply to adding word between any 3 lines on Mon, 06 Jan 2020 18:00:14 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>
<p dir="auto">Ha, didn’t even notice that.  Well, I guess the OP is <em>most</em> of the way there.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49692</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49692</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 06 Jan 2020 18:00:14 GMT</pubDate></item><item><title><![CDATA[Reply to adding word between any 3 lines on Mon, 06 Jan 2020 17:52:50 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> said in <a href="/post/49688">adding word between any 3 lines</a>:</p>
<blockquote>
<p dir="auto">I would try searching for <code>(?-s)^(?:.*\R){3}</code> and replacing with <code>[word]$0</code>.  Search mode = Regular expression</p>
</blockquote>
<p dir="auto">Something similar was my first thought, but that doesn’t get the <code>[word]</code> before the p and q lines, which was in the original spec.  I guess, like my solution, <a class="plugin-mentions-user plugin-mentions-a" href="/user/hasan123" aria-label="Profile: hasan123">@<bdi>hasan123</bdi></a> could manually do one <code>[word]</code> insertion. :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49690</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49690</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 06 Jan 2020 17:52:50 GMT</pubDate></item><item><title><![CDATA[Reply to adding word between any 3 lines on Mon, 06 Jan 2020 17:50:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hasan123" aria-label="Profile: hasan123">@<bdi>hasan123</bdi></a>,</p>
<p dir="auto">This will get you most of the way there:</p>
<ol>
<li>use <code>Ctrl+Home</code> to make sure you are at the start of the file</li>
<li>search/replace</li>
</ol>
<ul>
<li>FIND = <code>(?-s).+\R.+\R.+(\R|\Z)\K</code></li>
<li>REPLACE = <code>[word]</code> or <code>[word]\r\n</code></li>
<li>disable <strong>☐ wrap around</strong></li>
<li>mode = regular expression</li>
</ul>
<ol start="3">
<li><code>Ctrl+Home</code> then manually insert <code>[word]</code> at the start of the file.</li>
</ol>
<p dir="auto">I tried for some alternation, using <code>\A^|...</code> or similar to get it to also replace at the start of the file, but five minutes of experimenting wasn’t enough to get it to work.  Maybe <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> will chime in with an all-in-one, but for me, the curiosity of knowing how to get it in one regex doesn’t outweigh the additional time beyond 5min for exploring the intricacies of regex, when a few seconds of typing will add in the missing <code>[word]</code> at the beginning of the file.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49689</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49689</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 06 Jan 2020 17:50:53 GMT</pubDate></item><item><title><![CDATA[Reply to adding word between any 3 lines on Mon, 06 Jan 2020 17:48:27 GMT]]></title><description><![CDATA[<p dir="auto">I would try searching for <code>(?-s)^(?:.*\R){3}</code> and replacing with <code>[word]$0</code>.  Search mode = Regular expression</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49688</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49688</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 06 Jan 2020 17:48:27 GMT</pubDate></item></channel></rss>