<?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[Finding and replacing all data between two points?]]></title><description><![CDATA[<p dir="auto">Hey everyone, I’m editing some game transcripts to trim out unneeded information. I’m trying to figure out how find and replace all data between two points. The following is what the formatting looks like now. I want to be able to delete everything between &lt;/ORIGINAL N°00#&gt; and &lt;/COMMENT N°00#&gt;:</p>
<p dir="auto">&lt;SPEAKER N°001&gt;MAKOTO NAEGI&lt;/SPEAKER N°001&gt;<br />
&lt;ORIGINAL N°001&gt;<br />
&lt;CLT 4&gt;The entrance is still blocked by that giant hunk of<br />
metal.&lt;CLT&gt;<br />
&lt;/ORIGINAL N°001&gt;<br />
&lt;JAPANESE N°001&gt;<br />
&lt;CLT 4&gt;入口は…鉄の塊で塞がれてしまっている…&lt;CLT&gt;<br />
&lt;/JAPANESE N°001&gt;<br />
&lt;TRANSLATED N°001&gt;</p>
<h2>&lt;/TRANSLATED N°001&gt;<br />
&lt;COMMENT N°001&gt;<br />
&lt;/COMMENT N°001&gt;</h2>
<p dir="auto">&lt;SPEAKER N°002&gt;MAKOTO NAEGI&lt;/SPEAKER N°002&gt;<br />
&lt;ORIGINAL N°002&gt;<br />
&lt;CLT 4&gt;This mailbox doesn’t seem important right now.&lt;CLT&gt;<br />
&lt;/ORIGINAL N°002&gt;<br />
&lt;JAPANESE N°002&gt;<br />
&lt;CLT 4&gt;このレターケースは…<br />
今回の事件には関係ないよな…&lt;CLT&gt;<br />
&lt;/JAPANESE N°002&gt;<br />
&lt;TRANSLATED N°002&gt;</p>
<p dir="auto">&lt;/TRANSLATED N°002&gt;<br />
&lt;COMMENT N°002&gt;<br />
&lt;/COMMENT N°002&gt;</p>
<h2>It’s a lot of unnecessary data that adds about 2 thousand extra pages to the document.<br />
I successfully did it last year but for the life of me can’t remember how and google isn’t helping. I had to change the N°### in the Find box for every new line of dialogue (and make sure it was the same for /ORIGINAL and /COMMENT or it’d cut out vital information from subsequent entries. So I’d do 001, then 002, then 003, etc. The successful result looks like this:<br />
&lt;SPEAKER N°038&gt;KIYOTAKA ISHIMARU&lt;/SPEAKER N°038&gt;<br />
&lt;ORIGINAL N°038&gt;<br />
Okay, then let’s split up and start investigating!</h2>
<p dir="auto">&lt;SPEAKER N°039&gt;KIYOTAKA ISHIMARU&lt;/SPEAKER N°039&gt;<br />
&lt;ORIGINAL N°039&gt;<br />
When you’re done, everyone meet back up at the dining<br />
hall and we’ll share what we found!</p>
<p dir="auto">Considering the massive amount of data in this document, manually searching for, highlighting, and deleting each instance of this is incredibly time consuming and really hurts my hands. Can anyone help me figure out how to do this? I’d just be replacing the found range with either a space or nothing. (Also apologies in advance if this is hard to understand, I can’t for the life of me figure out how to word any of this!)</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/17823/finding-and-replacing-all-data-between-two-points</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 23:53:59 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/17823.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 17 Jun 2019 06:41:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Tue, 02 Jul 2019 09:57:13 GMT]]></title><description><![CDATA[<p dir="auto">Hi <strong>Joey</strong>,</p>
<p dir="auto">Thanks for your <strong>kind</strong> words ! You said :</p>
<blockquote>
<p dir="auto">Is there any way I can make it up to you?</p>
</blockquote>
<p dir="auto">Thanks, but I don’t need anything !! I’m just pleased that the <strong>last</strong> regexes are the <strong>good</strong> ones for your <strong>specific</strong> file !</p>
<hr />
<p dir="auto">This is the <strong>main</strong> point, indeed ! Regexes are very, very, very <strong>sensitive</strong> to text layout. So, once I’ve built up some regex for an <strong>OP</strong>, based on his provided examples, the OP should <strong>not</strong> add, delete or modify anything of the <strong>original</strong> text, in the <strong>meanwhile</strong>, as, probably, the regex will <strong>not</strong> work anymore ;-))</p>
<p dir="auto">As far as possible, anyone, asking for <strong>regex</strong> solutions, should consider <strong>all</strong> cases of text layouts, of the <strong>original</strong> file to modify ;-))</p>
<p dir="auto">It’s generally, <strong>not</strong> so obvious, and, in my personal work, I simply create <strong>successive</strong> versions of the regex to get a <strong>final</strong> version which handles all <strong>reasonable</strong> cases !</p>
<p dir="auto">I say <strong>reasonable</strong> ( and not <strong>possible</strong> ) because, sometimes, we can’t think about <strong>all</strong> the possibilities and, anyway, this could lead to an <strong>huge</strong> and <strong>useless</strong> regex ;-))</p>
<p dir="auto">Best Regards</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45022</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45022</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 02 Jul 2019 09:57:13 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Tue, 02 Jul 2019 05:52:24 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><br />
It works! Thank you so much for all the help, and for accommodating my requests and frequent regex-breaking! It means a lot to me, and you’ve saved me soooo much time and hand pain!! Is there any way I can make it up to you? I could draw you something :D</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45020</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45020</guid><dc:creator><![CDATA[Joey Flaig]]></dc:creator><pubDate>Tue, 02 Jul 2019 05:52:24 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Thu, 27 Jun 2019 09:14:17 GMT]]></title><description><![CDATA[<p dir="auto">Hello @@joey-flaig and <strong>All</strong>,</p>
<p dir="auto">Aaaah ! As soon as I saw the <strong>picture</strong> of your text, in the background, I understood what happened ;-))</p>
<p dir="auto">Of course, considering the first entry <strong><code>N°001</code></strong> and supposing you’ve executed the <strong><code>B</code></strong> regex S/R <strong>first</strong> ( <strong><code>46</code></strong> occurrences replaced ), I was <strong>expecting</strong> :</p>
<pre><code class="language-xml">&lt;SPEAKER N°001&gt;KIYOTAKA ISHIMARU&lt;/SPEAKER N°001&gt;
&lt;ORIGINAL N°001&gt;
Would you like to study with me, Makoto? Just the two of us?
&lt;/ORIGINAL N°001&gt;
&lt;JAPANESE N°001&gt;
苗木くん！
どうだ、これから一緒に自習しないか！？
&lt;/JAPANESE N°001&gt;
&lt;TRANSLATED N°001&gt;

&lt;/TRANSLATED N°001&gt;
&lt;COMMENT N°001&gt;

&lt;/COMMENT N°001&gt;
</code></pre>
<p dir="auto">But, seemingly, you’ve <strong>already</strong> changed the <strong><code>N°001</code></strong> entry, as below :</p>
<pre><code class="language-xml">&lt;SPEAKER N°001&gt;KIYOTAKA ISHIMARU&lt;/SPEAKER N°001&gt;
&lt;ORIGINAL N°001&gt;
Would you like to study with me, Makoto? Just the two of us?&lt;/ORIGINAL N°001&gt;&lt;JAPANESE N°001&gt;
苗木くん！どうだ、これから一緒に自習しないか！？&lt;/JAPANESE N°001&gt;
&lt;TRANSLATED N°001&gt;

&lt;/TRANSLATED N°001&gt;
&lt;COMMENT N°001&gt;

&lt;/COMMENT N°001&gt;
</code></pre>
<p dir="auto">It easy to see <strong>why</strong> this <strong>new</strong> text layout breaks the <strong>logic</strong> of the <strong><code>A</code></strong> search regex. Indeed, I, <strong>initially</strong>, supposed that the part <strong><code>&lt;/ORIGINAL N°001&gt;</code></strong> was, always, at <strong>beginning</strong> of lines !</p>
<p dir="auto">So, the <strong>final</strong> S/R <strong><code>A</code></strong> becomes :</p>
<p dir="auto">SEARCH <strong><code>(?s-i)(^)?\h*&lt;/ORIGINAL\x20N°(\d+)&gt;.+?&lt;/COMMENT\x20N°\2&gt;\R</code></strong></p>
<p dir="auto">REPLACE <strong><code>?1:\r\n</code></strong></p>
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">This <strong>new</strong> <strong><code>A</code></strong> regex looks for the string <strong><code>&lt;/ORIGINAL N°###&gt;</code></strong>, possibly <strong>preceded</strong> with <strong>blank</strong> characters, at <strong>any</strong> location of <strong>current</strong> line, due to the <strong>optional</strong> syntax <strong><code>(^)?</code></strong></p>
</li>
<li>
<p dir="auto">In <strong>replacement</strong>, <strong><code>2</code></strong> possibilities :</p>
<ul>
<li>
<p dir="auto">If the string <strong><code>&lt;/ORIGINAL N°###&gt;</code></strong> is at a <strong>beginning</strong> of <strong>current</strong> line, the <strong>group <code>1</code></strong> exists, so the <strong>conditional</strong> replacement <strong><code>?1</code></strong> rewrites all text <strong>before</strong> the <strong><code>:</code></strong> char, so … <strong><code>nothing</code></strong></p>
</li>
<li>
<p dir="auto">If the string <strong><code>&lt;/ORIGINAL N°###&gt;</code></strong> is located <strong>elsewhere</strong>, the <strong><code>^</code></strong> location is <strong>not</strong> true. So the <strong>group<code>1</code></strong> is <strong>not</strong> defined and the <strong>conditional</strong> replacement <strong><code>?1</code></strong> rewrites all text, <strong>after</strong> the <strong><code>:</code></strong> char, so a <strong>line break</strong> <strong><code>\r\n</code></strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto">That’s <strong>all</strong> ;-)) This time, you should see the message <strong><code>Replace All: 82 occurrences were replaced</code></strong></p>
<p dir="auto"><strong>Remark</strong> : Of course, I, also, verified that your <strong>new</strong> text layout does <strong>not</strong> break the logic of S/R <strong><code>B</code></strong> !</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44930</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44930</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 27 Jun 2019 09:14:17 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Thu, 27 Jun 2019 06:34:40 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><br />
I wish I’d thought to send you the files themselves at first, haha! You’re great!</p>
<p dir="auto">The B S/R regex to turn two-line dialogues into one-line dialogues works like a charm!</p>
<p dir="auto">However, the a S/R regex to remove the extra data doesn’t seem to work at all. I tried it in the order of B + A, then A + B, and even A by itself, but it’s not doing anything. I made sure to always use Replace All for both regexes.  Is there a setting I shouldn’t have checked?<br />
<a href="https://imgur.com/nIPe0w3" rel="nofollow ugc">https://imgur.com/nIPe0w3</a></p>
<p dir="auto">Also,  if it matters - I’m using the 32 bit version of NPP [I had to in order to use the Combiner plugin]</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44927</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44927</guid><dc:creator><![CDATA[Joey Flaig]]></dc:creator><pubDate>Thu, 27 Jun 2019 06:34:40 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Wed, 26 Jun 2019 19:22:51 GMT]]></title><description><![CDATA[<p dir="auto">Hi, @@joey-flaig and <strong>All</strong>,</p>
<p dir="auto">This time, <strong>no</strong> trouble ! I’ve found the <strong>right</strong> regex S/R, which is, BTW, much more <strong>simple</strong> that anything else tried before !</p>
<p dir="auto">As usual, having the <strong>exact</strong> bunch of data, to work on, is always the <strong>best</strong> solution !</p>
<p dir="auto">After downloading your complete <strong><code>XML</code></strong> file, I noticed <strong>two</strong> things :</p>
<ul>
<li>
<p dir="auto">Some dialog do <strong>not</strong> begin with any tag <strong><code>&lt;CLT ##&gt;</code></strong> nor <strong><code>&lt;CLT&gt;</code></strong>  =&gt; We <strong>cannot</strong> rely on these tags and should prefer to consider <strong><code>&lt;ORIGINAL N°###&gt;</code></strong> as an <strong>anchor</strong> :-))</p>
</li>
<li>
<p dir="auto">When dialog is <strong>multi</strong>-lines, it is <strong>always</strong> split in <strong>two</strong> lines !</p>
</li>
<li>
<p dir="auto">More anecdotal, your file is an <strong><code>UNIX</code></strong> file, with the <strong><code>UCS-2 LE BOM</code></strong> encoding</p>
</li>
</ul>
<hr />
<p dir="auto">So, as a <strong>summary</strong> :</p>
<ul>
<li>
<p dir="auto">To <strong>remove</strong> the extra data, <strong>not</strong> needed, use the <strong><code>A</code></strong> <strong>S/R</strong> :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?s-i)^\h*&lt;/ORIGINAL\x20N°(\d+)&gt;.+?&lt;/COMMENT\x20N°\1&gt;\R</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>Leave EMPTY</code></strong></p>
</li>
</ul>
</li>
<li>
<p dir="auto">To change the <strong>two</strong>-lines dialog in a <strong>one</strong>-line dialog, use the <strong><code>B</code></strong> <strong>S/R</strong> :</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?-si)&lt;ORIGINAL N°\d+&gt;\R.+\K\R(?!-{60}|&lt;/ORIGINAL N°\d+&gt;)</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>\x20</code></strong></p>
</li>
</ul>
</li>
</ul>
<hr />
<p dir="auto"><strong>IMPORTANT</strong> :</p>
<ul>
<li>
<p dir="auto">Assuming your <strong>present</strong> data, your may execute the search/replacement <strong><code>B</code></strong>, <strong>first</strong> and, <strong>secondly</strong>, the <strong><code>A</code></strong> S/R ;-))</p>
</li>
<li>
<p dir="auto">I’ve supposed that your <strong>separation</strong> line <strong>always</strong> contains <strong><code>60</code></strong> dashes, exactly. If <strong>not</strong>, change the value <strong><code>60</code></strong> , between <strong>braces</strong>, in the <strong>search</strong> regex, accordingly</p>
</li>
<li>
<p dir="auto"><strong>Remember</strong> to click on the <strong><code>Replace All</code></strong> button, <strong>exclusively</strong>, when running the <strong><code>B</code></strong> S/R !</p>
</li>
</ul>
<hr />
<p dir="auto">NOTES on the <strong><code>B</code></strong> <strong>new</strong> regex :</p>
<ul>
<li>
<p dir="auto">First, the part <strong><code>&lt;ORIGINAL N°\d+&gt;\R.+</code></strong> looks for the <strong>complete</strong> line <strong><code>&lt;ORIGINAL N°###&gt;</code></strong> with its <strong>EOL</strong> character, followed with <strong>all</strong> the <strong>standard</strong> characters of the <strong>next</strong> line ( <strong><code>1st</code></strong> line of dialog )</p>
</li>
<li>
<p dir="auto">Then, the syntax <strong><code>\K\R</code></strong> <strong>resets</strong> the regex engine and it, now, looks the the <strong>EOL</strong> characters of the <strong><code>1st</code></strong> line of dialog</p>
</li>
<li>
<p dir="auto">But this search occurred <em>ONLY IF</em>  the <strong>EOL</strong> chars are <strong>NOT</strong> followed with, <strong>either</strong>, a line of <strong><code>60</code></strong> dashes OR the string <strong><code>&lt;/ORIGINAL N°###&gt;</code></strong></p>
</li>
</ul>
<p dir="auto">Best regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44865</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44865</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 26 Jun 2019 19:22:51 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Wed, 26 Jun 2019 06:18:54 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">I hope you and your family had a good time! It’s been a long time, but my dad still misses going on field trips with me and my class when I was younger. Precious memories! :DD I’m glad he was with me when I fell in the fish pond at the local zoo!</p>
<p dir="auto">Thank you for all of this! This is so close, aaaaaaahhhh! I just realized - this would’ve been a lot easier if I’d just linked one of the transcript files:<br />
<a href="https://drive.google.com/open?id=141c3d3ZBOb_GG3Psb9eQaaiWUl-g-ATF" rel="nofollow ugc">https://drive.google.com/open?id=141c3d3ZBOb_GG3Psb9eQaaiWUl-g-ATF</a></p>
<p dir="auto">I followed what you said to do in your most recent post. Doing the first regex (to cut out the extra data I don’t need) works, but when I do the second regex (to turn the multi-line dialogue into mono-line dialogue), the problem from my previous post still happens:</p>
<p dir="auto"><a href="https://drive.google.com/open?id=11ChQl7D9YZ80COaxyadjjBl-tIp5aTPJ" rel="nofollow ugc">https://drive.google.com/open?id=11ChQl7D9YZ80COaxyadjjBl-tIp5aTPJ</a></p>
<p dir="auto">I tried doing the mono-line regex first. Then that one did its job and looked like your expected text… but when I did the extra data removal regex after, then that one didn’t work!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44860</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44860</guid><dc:creator><![CDATA[Joey Flaig]]></dc:creator><pubDate>Wed, 26 Jun 2019 06:18:54 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Sat, 19 Nov 2022 03:32:45 GMT]]></title><description><![CDATA[<p dir="auto">Hello, @@joey-flaig and <strong>All</strong>,</p>
<p dir="auto">So yesterday, my wife and I were accompanying <strong>7/8</strong> years old children ( our <strong>daughter</strong>’s class +<strong>2</strong> other classes ), on a <strong>school trip</strong> and then, in the late afternoon, I preferred to watch the <strong>USA-Spain</strong> match of the women’s world football championship ! Of course, I wanted to know who <strong>France</strong>’s opponent would be ;-))</p>
<hr />
<p dir="auto">Ah ! I understood why the <strong>separation</strong> line, made up of <strong><code>60</code> dashes</strong>, was missing in the <strong>original</strong> <strong>Joey</strong>’s post ! Just because, due to the <strong>MarkDown</strong> syntax, any line of, at least, <strong><code>3</code> dashes</strong> produces a slight <strong>gray horizontal</strong> rule, instead ;-))</p>
<p dir="auto">So, <strong>Joey</strong>, just forget, my quick <strong>previous</strong> post and let’s <strong>recapitulate</strong> all the process :</p>
<hr />
<p dir="auto">We’ll start with this sample text of <strong><code>4</code></strong> blocks, between the lines of <strong>dashes</strong>. In <strong>two</strong> of them, I placed some <strong>multi</strong>-lines text, inside the section <strong><code>&lt;CLT 4&gt;.............&lt;CLT&gt;</code></strong></p>
<pre><code class="language-diff">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;SPEAKER N°001&gt;MAKOTO NAEGI&lt;/SPEAKER N°001&gt;
&lt;ORIGINAL N°001&gt;
&lt;CLT 4&gt;Just some   
    
   
     text to test
my new
regex !   
&lt;CLT&gt;
&lt;/ORIGINAL N°001&gt;
&lt;JAPANESE N°001&gt;
&lt;CLT 4&gt;入口は…鉄の塊で塞がれてしまっている…&lt;CLT&gt;
&lt;/JAPANESE N°001&gt;
&lt;TRANSLATED N°001&gt;

&lt;/TRANSLATED N°001&gt;
&lt;COMMENT N°001&gt;
&lt;/COMMENT N°001&gt;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;SPEAKER N°002&gt;MAKOTO NAEGI&lt;/SPEAKER N°002&gt;
&lt;ORIGINAL N°002&gt;
&lt;CLT 4&gt;This mailbox doesn’t seem important right now.&lt;CLT&gt;
&lt;/ORIGINAL N°002&gt;
&lt;JAPANESE N°002&gt;
&lt;CLT 4&gt;このレターケースは…
今回の事件には関係ないよな…&lt;CLT&gt;
&lt;/JAPANESE N°002&gt;
&lt;TRANSLATED N°002&gt;

&lt;/TRANSLATED N°002&gt;
&lt;COMMENT N°002&gt;
&lt;/COMMENT N°002&gt;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;SPEAKER N°003&gt;MAKOTO NAEGI&lt;/SPEAKER N°003&gt;
&lt;ORIGINAL N°003&gt;
&lt;CLT 4&gt;The entrance is still blocked by that giant hunk of
metal.&lt;CLT&gt;
&lt;/ORIGINAL N°003&gt;
&lt;JAPANESE N°003&gt;
&lt;CLT 4&gt;入口は…鉄の塊で塞がれてしまっている…&lt;CLT&gt;
&lt;/JAPANESE N°003&gt;
&lt;TRANSLATED N°003&gt;

&lt;/TRANSLATED N°003&gt;
&lt;COMMENT N°003&gt;
&lt;/COMMENT N°003&gt;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;SPEAKER N°004&gt;MAKOTO NAEGI&lt;/SPEAKER N°004&gt;
&lt;ORIGINAL N°004&gt;
&lt;CLT 4&gt;An other   
     text to see
how the
regex works&lt;CLT&gt;
&lt;/ORIGINAL N°004&gt;
&lt;JAPANESE N°004&gt;
&lt;CLT 4&gt;入口は…鉄の塊で塞がれてしまっている…&lt;CLT&gt;
&lt;/JAPANESE N°004&gt;
&lt;TRANSLATED N°004&gt;

&lt;/TRANSLATED N°004&gt;
&lt;COMMENT N°004&gt;
&lt;/COMMENT N°004&gt;
</code></pre>
<p dir="auto">Using the regex S/R, below, we keep the <strong>interesting</strong> part of each block, from <strong>Joey</strong>’s point of view, of course !</p>
<p dir="auto">SEARCH <strong><code>(?s-i)^\h*&lt;/ORIGINAL\x20N°(\d+)&gt;.+?&lt;/COMMENT\x20N°\1&gt;\R</code></strong></p>
<p dir="auto">REPLACE <strong><code>Leave EMPTY</code></strong></p>
<p dir="auto">And we get :</p>
<pre><code class="language-diff">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;SPEAKER N°001&gt;MAKOTO NAEGI&lt;/SPEAKER N°001&gt;
&lt;ORIGINAL N°001&gt;
&lt;CLT 4&gt;Just some   
    
   
     text to test
my new
regex !   
&lt;CLT&gt;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;SPEAKER N°002&gt;MAKOTO NAEGI&lt;/SPEAKER N°002&gt;
&lt;ORIGINAL N°002&gt;
&lt;CLT 4&gt;This mailbox doesn’t seem important right now.&lt;CLT&gt;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;SPEAKER N°003&gt;MAKOTO NAEGI&lt;/SPEAKER N°003&gt;
&lt;ORIGINAL N°003&gt;
&lt;CLT 4&gt;The entrance is still blocked by that giant hunk of
metal.&lt;CLT&gt;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;SPEAKER N°004&gt;MAKOTO NAEGI&lt;/SPEAKER N°004&gt;
&lt;ORIGINAL N°004&gt;
&lt;CLT 4&gt;An other   
     text to see
how the
regex works&lt;CLT&gt;
</code></pre>
<p dir="auto">Now, in order to change all <strong>multi</strong>-lines sections <strong><code>&lt;CLT 4&gt;.............&lt;CLT&gt;</code></strong> into a <strong>mono</strong>-line one, use the <strong>following</strong> regex S/R :</p>
<p dir="auto">SEARCH <strong><code>(?-s)(?:(?!&lt;|&gt;|-).)+?\K(?:\h*\R\h*)++(?=(&lt;CLT&gt;)|.+)</code></strong></p>
<p dir="auto">REPLACE <strong><code>?1:\x20</code></strong></p>
<p dir="auto">And here is your <strong>expected</strong> text :</p>
<pre><code class="language-diff">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;SPEAKER N°001&gt;MAKOTO NAEGI&lt;/SPEAKER N°001&gt;
&lt;ORIGINAL N°001&gt;
&lt;CLT 4&gt;Just some text to test my new regex !&lt;CLT&gt;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;SPEAKER N°002&gt;MAKOTO NAEGI&lt;/SPEAKER N°002&gt;
&lt;ORIGINAL N°002&gt;
&lt;CLT 4&gt;This mailbox doesn’t seem important right now.&lt;CLT&gt;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;SPEAKER N°003&gt;MAKOTO NAEGI&lt;/SPEAKER N°003&gt;
&lt;ORIGINAL N°003&gt;
&lt;CLT 4&gt;The entrance is still blocked by that giant hunk of metal.&lt;CLT&gt;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&lt;SPEAKER N°004&gt;MAKOTO NAEGI&lt;/SPEAKER N°004&gt;
&lt;ORIGINAL N°004&gt;
&lt;CLT 4&gt;An other text to see how the regex works&lt;CLT&gt;
</code></pre>
<p dir="auto"><strong>Notes</strong> on the <strong><code>2nd</code></strong> regex :</p>
<ul>
<li>
<p dir="auto">First, the <strong>in-line</strong> modifier <strong><code>(?-s)</code></strong> means that the regex char <strong><code>.</code></strong> represents a <strong>single standard</strong> character, only !</p>
</li>
<li>
<p dir="auto">Then, the part <strong><code>(?:(?!&lt;|&gt;|-).)+?</code></strong> looks for the <strong>smallest non-null</strong> range of <strong>standard</strong> characters, different from <strong><code>&lt;</code></strong>, <strong><code>&gt;</code></strong> and <strong><code>-</code></strong>, in a <strong>non-capturing</strong> group, till… … … the next <strong>main</strong> part</p>
</li>
<li>
<p dir="auto">This <strong>main</strong> part is <strong><code>\K(?:\h*\R\h*)++</code></strong> which <strong>resets</strong> the regex engine first ( <strong><code>\K</code></strong> ), then searches for any <strong>non-null</strong> blocks of <strong>EOL</strong> chars, possibly surrounded with <strong>blank</strong> characters, placed in a <strong>non-capturing</strong> group, without any <strong>backtracking</strong> in that part, due to the <strong>possessive</strong> quantifier <strong><code>++</code></strong></p>
</li>
<li>
<p dir="auto">The final part <strong><code>(?=(&lt;CLT&gt;)|.+)</code></strong> is a <strong>dummy look-ahead</strong> structure, which defines an <strong>always-true</strong> condition ! Indeed, the block of <strong>EOL</strong> chars searched must be <strong>followed</strong> by, either, the string <strong>&lt;CLT&gt;</strong>, stored as <strong>group <code>1</code></strong> or any <strong>non-null</strong> range  of <strong>standard</strong> chars</p>
</li>
<li>
<p dir="auto">The main advantage of this <strong>odd</strong> syntax is that, if the <strong>EOL</strong> chars are followed with the <strong>specific</strong> string <strong>&lt;CLT&gt;</strong>, we won’t replace with a <strong><code>space</code></strong> character but simply <strong>delete</strong> this <strong>EOL</strong> block, which can be achieved with the <strong>conditional</strong> replacement <strong><code>?1:\x20</code></strong>, meaning :</p>
</li>
<li>
<p dir="auto">If <strong>group <code>1</code></strong> exists, replace with the <strong><code>EMPTY</code></strong> string</p>
</li>
<li>
<p dir="auto">If <strong>group <code>1</code></strong> does <strong>not</strong> exist, replace with a <strong><code>space</code></strong> character</p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44818</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44818</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 19 Nov 2022 03:32:45 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Mon, 24 Jun 2019 12:53:42 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> said:</p>
<blockquote>
<p dir="auto">I’ve got no much time, right now</p>
</blockquote>
<p dir="auto">And it seems like you could have a full time job, writing this person’s regexes!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44801</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44801</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 24 Jun 2019 12:53:42 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Mon, 24 Jun 2019 08:10:58 GMT]]></title><description><![CDATA[<p dir="auto">Hi, @@joey-flaig and <strong>All</strong>,</p>
<p dir="auto">I’ve got <strong>no</strong> much time, right now ! So try the <strong>exact</strong> regex, below :</p>
<p dir="auto">SEARCH <strong><code>(?-si)^&lt;ORIGINAL N°\d+&gt;\R.+?\K\h*\R\h*+(?!&lt;|-{5,})</code></strong></p>
<p dir="auto">REPLACE <strong><code>\x20</code></strong></p>
<p dir="auto">I’ll explain to you when I’m back, about <strong>six</strong> hours later !</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44799</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44799</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 24 Jun 2019 08:10:58 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Mon, 24 Jun 2019 05:48:04 GMT]]></title><description><![CDATA[<p dir="auto">Yeah, this is what I was looking to do! This regex looks great… but it sometimes fuses the line indicating a speaker change [the ones with all the dashes that look like ----------------) with the dialogue! Any way to tweak the regex to prevent that?</p>
<p dir="auto"><a href="https://imgur.com/OhYLhBM" rel="nofollow ugc">https://imgur.com/OhYLhBM</a></p>
<p dir="auto">If it matters, the speaker change lines contain 60 dashes!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44798</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44798</guid><dc:creator><![CDATA[Joey Flaig]]></dc:creator><pubDate>Mon, 24 Jun 2019 05:48:04 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Fri, 21 Jun 2019 16:15:38 GMT]]></title><description><![CDATA[<p dir="auto">Hi @@joey-flaig and <strong>All</strong>,</p>
<p dir="auto">Ah, I <strong>clearly</strong> see, now, what you’re looking for ;-)) Actually, you don’t mind about the tags <strong><code>&lt;CLT 4&gt;</code></strong> and <strong><code>&lt;CLT&gt;</code></strong> at all !</p>
<p dir="auto">So, the <strong>magic</strong> regex is :</p>
<p dir="auto">SEARCH <strong><code>(?-si)^&lt;ORIGINAL N°\d+&gt;\R.+?\K\h*\R\h*(?!&lt;)</code></strong></p>
<p dir="auto">REPLACE <strong><code>\x20</code></strong></p>
<ul>
<li>
<p dir="auto">Tick, preferably, the <strong><code>Wrap around</code></strong> option</p>
</li>
<li>
<p dir="auto">Select the <strong><code>Regular expression</code></strong> search mode</p>
</li>
<li>
<p dir="auto">Due to the <strong><code>\K</code></strong> syntax, you must use the <strong><code>Replace All</code></strong> button, <strong>exclusively</strong></p>
</li>
</ul>
<p dir="auto">Et voilà !</p>
<hr />
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">First, as usual, the <strong>in-line</strong> modifiers <strong><code>(?s-i)</code></strong> :</p>
<ul>
<li>
<p dir="auto">Forces to regex engine to interpret any <strong>dot</strong> ( <strong><code>.</code></strong> ) as representing any <strong>single</strong> character, even <strong>EOL</strong> characters, <strong><code>(?-s)</code></strong></p>
</li>
<li>
<p dir="auto">Forces the search to be processed in a <strong>non-insensitive</strong> way,  <strong><code>(?-i)</code></strong></p>
</li>
</ul>
</li>
<li>
<p dir="auto">Then, from beginning of line ( <strong><code>^</code></strong> ), the regex searches for	the string <strong>&lt;ORIGINAL N°</strong>, followed with some digits ( <strong><code>\d+</code></strong> ), followed with the <strong><code>&gt;</code></strong> symbol, closed to its <strong>EOL</strong> chars ( <strong><code>\R</code></strong>)</p>
</li>
<li>
<p dir="auto">Now, on the line, <strong>following</strong> the line <strong><code>&lt;ORIGINAL N°###&gt;</code></strong>, it looks for the <strong>shortest</strong> range of <strong>standard</strong> characters ( <strong><code>.+?</code></strong> )</p>
</li>
<li>
<p dir="auto">At this point, the <strong><code>\K</code></strong> syntax <strong>resets</strong> the regex engine <strong>search</strong> and <strong>position</strong>. So, from now on, the <strong>final</strong> search looks for possible <strong>blank</strong> characters followed with <strong>EOL</strong> chars, followed, again, with possible <strong>blank</strong> chars ( <strong><code>\h*\R\h*</code></strong> )</p>
</li>
<li>
<p dir="auto">But this search happens <em>ONLY IF</em>  the <strong>negative</strong> look-ahead <strong><code>(?!&lt;)</code></strong> is <strong>verified</strong>, i.e. if the <strong>next</strong> line does <strong>not</strong> begin with the <strong><code>&lt;</code></strong> symbol ( =&gt; is, simply, the <strong>continuation</strong> text of the <strong>previous</strong> line )</p>
</li>
<li>
<p dir="auto">In that case, the <strong>EOL</strong> characters, possibly <strong>surrounded</strong> with <strong>blank</strong> characters, are replaced with a <strong>single space</strong> character ( <strong><code>\x20</code></strong> )</p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
<p dir="auto"><strong>P.S.</strong> :</p>
<ul>
<li>
<p dir="auto">The fact of <strong>searching</strong> for <strong><code>\h*\R\h*</code></strong> and <strong>replacing</strong> the <strong><code>\x20</code></strong> ensures you that the <strong>two</strong> parts of the text  will be <strong>always</strong> joined with an <strong>unique</strong> <strong><code>space</code></strong> character ;-))</p>
</li>
<li>
<p dir="auto">If, <strong>between</strong> the tags <strong><code>&lt;ORIGINAL N°###&gt;</code></strong> and <strong><code>&lt;/ORIGINAL N°###&gt;</code></strong>, you have <strong>more</strong> than <strong><code>2</code></strong> lines of text, like below :</p>
</li>
</ul>
<pre><code class="language-diff">&lt;ORIGINAL N°001&gt;
&lt;CLT 4&gt;The entrance
    is still blocked
        by that
giant
   hunk of
metal.&lt;CLT&gt;
&lt;/ORIGINAL N°001&gt;
</code></pre>
<p dir="auto">No problem ! Just click, <strong>several</strong> times, on the <strong><code>Replace All</code></strong> button, until the message <strong><code>Replace All: 0 occurrences were replaced.</code></strong> occurs ;-))</p>
<p dir="auto">And you’ll be left with :</p>
<pre><code class="language-diff">&lt;ORIGINAL N°001&gt;
&lt;CLT 4&gt;The entrance is still blocked by that giant hunk of metal.&lt;CLT&gt;
&lt;/ORIGINAL N°001&gt;
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/44760</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44760</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Fri, 21 Jun 2019 16:15:38 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Fri, 21 Jun 2019 09:20:43 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><br />
Oooh, both these solutions are really handy! They don’t quite work for what I’m looking for though, because there aren’t <em>empty</em> lines, but rather unnecessary line breaks in the middle of sentences. So they didn’t do anything.</p>
<p dir="auto"><a href="https://imgur.com/cgNiSsX" rel="nofollow ugc">Like this</a></p>
<p dir="auto">After playing around with the Line Operations feature, I found one called Join Lines. If I select both lines 32 and 33 and hit Join Lines, it gives me the desired effect of merging them into one.</p>
<p dir="auto">Now that I know what NPP+ can do a little bit better, I’ve come up with a more precise way of speaking. Here’s what I want:  <em>I’m looking for some way to automatically Join Lines in places where dialogue is more than one line (and therefore contains a line break/Return).</em>  The text that would be checked for this always starts on the line <em>after</em> the &lt;ORIGINAL N°00#&gt; line. Otherwise it would join the coding, SPEAKER, and ORIGINAL line with all the dialogue automatically and that would be a pain to take apart later). Some kind of process or find and replace would be ideal for this because there are thousands of lines I’d have to manually look through.</p>
<p dir="auto">This seems to be getting more and more complicated! Does this make more sense now?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44754</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44754</guid><dc:creator><![CDATA[Joey Flaig]]></dc:creator><pubDate>Fri, 21 Jun 2019 09:20:43 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Thu, 20 Jun 2019 06:58:17 GMT]]></title><description><![CDATA[<p dir="auto">Hello, @@joey-flaig and <strong>All</strong>,</p>
<p dir="auto">Ah, OK ! If you want to wipe out any <strong>empty</strong> line or any <strong>empty</strong> line, containing <strong>blank</strong> characters, <strong>two</strong> solutions :</p>
<ul>
<li>
<p dir="auto">Use the <strong>built-in</strong> N++ commands <strong><code>Edit &gt; Line Operations &gt; Remove Empty Lines</code></strong> or <strong><code>Edit &gt; Line Operations &gt; Remove Empty Lines (Containing Blank characters)</code></strong></p>
</li>
<li>
<p dir="auto">Use the <strong>search</strong> regexes, accordingly, <strong><code>(^\R)+</code></strong> or <strong><code>^(\h*\R)+</code></strong> and leave the <strong>Replacement</strong> zone <strong><code>EMPTY</code></strong></p>
</li>
</ul>
<p dir="auto">BR<br />
guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44689</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44689</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 20 Jun 2019 06:58:17 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Wed, 19 Jun 2019 20:13:09 GMT]]></title><description><![CDATA[<p dir="auto">Ah,  I’m sorry for the confusion! What I mean is that not all dialogue in the game is between &lt;CTL&gt; coding. The regex you made to gets rid of the line break in the dialogue, but only when the dialogue was preceded by &lt;CTL&gt;. So said regex doesn’t remove the line break for <em>all</em> the dialogue, just the portions that are preceeded by &lt;CTL&gt;. I’m looking to remove all dialogue line breaks. Does that make more sense? I can show you screencaps if needed!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44684</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44684</guid><dc:creator><![CDATA[Joey Flaig]]></dc:creator><pubDate>Wed, 19 Jun 2019 20:13:09 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Wed, 19 Jun 2019 12:10:27 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/joey-flaig" aria-label="Profile: joey-flaig">@<bdi>joey-flaig</bdi></a>,</p>
<p dir="auto">You said :</p>
<blockquote>
<p dir="auto">So your solution got some, but not all!</p>
</blockquote>
<p dir="auto">I don’t understand <strong>exactly</strong> what you mean ! In case, the <strong>Multi</strong>-lignes, or <strong>not</strong>, part <strong><code>&lt;CLT 4&gt;...........&lt;CLT&gt;</code></strong> is totally <strong>absent</strong>, as below, my <strong>previous</strong> regex ( which I <strong>slightly</strong> changed, BTW ! ) does <strong>not</strong> match any <strong>EOL</strong> char, anyway !?</p>
<pre><code class="language-diff">&lt;SPEAKER N°001&gt;MAKOTO NAEGI&lt;/SPEAKER N°001&gt;
&lt;ORIGINAL N°001&gt;
&lt;/ORIGINAL N°001&gt;
&lt;JAPANESE N°001&gt;
&lt;CLT 4&gt;入口は…鉄の塊で塞がれてしまっている…&lt;CLT&gt;
&lt;/JAPANESE N°001&gt;
&lt;TRANSLATED N°001&gt;

&lt;/TRANSLATED N°001&gt;
&lt;COMMENT N°001&gt;
&lt;/COMMENT N°001&gt;
</code></pre>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44672</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44672</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 19 Jun 2019 12:10:27 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Wed, 19 Jun 2019 09:48:29 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> said:<br />
Oh, this helps! I forgot to clarify - stuff marked by &lt;CLT&gt; is just colored text to denote in game importance or the protagonist’s internal thoughts and most of the dialogue doesn’t actually have it, it just looks like this:</p>
<h2>&lt;SPEAKER N°004&gt;MONOKUMA&lt;/SPEAKER N°004&gt;<br />
&lt;ORIGINAL N°004&gt;<br />
Well then. Since you’re all giving it your best, your<br />
generous headmaster will give you a little hint!</h2>
<p dir="auto">So your solution got some, but not all!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44664</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44664</guid><dc:creator><![CDATA[Joey Flaig]]></dc:creator><pubDate>Wed, 19 Jun 2019 09:48:29 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Wed, 19 Jun 2019 11:59:09 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/joey-flaig" aria-label="Profile: joey-flaig">@<bdi>joey-flaig</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: ekopalypse">@<bdi>ekopalypse</bdi></a> and <strong>All</strong>,</p>
<p dir="auto"><strong>Glad</strong> to see that this S/R saved you some <strong>hours</strong> of work ;-))</p>
<p dir="auto">No problem, to solve this <strong>new</strong> and easy challenge, <strong>Joey</strong> !</p>
<hr />
<p dir="auto">So, this could be translated, in <strong>current</strong> language, as:</p>
<p dir="auto">Replace any <strong>end of line</strong> character(s) with a <strong>space</strong> character <em>only if</em>  the <strong>following</strong> line :</p>
<ul>
<li>
<p dir="auto">Does <strong>not</strong> start with the string <strong><code>&lt;CLT 4&gt;</code></strong></p>
</li>
<li>
<p dir="auto">Does end with the string <strong><code>&lt;CLT&gt;</code></strong></p>
</li>
</ul>
<p dir="auto">This leads to the <strong>regex</strong> solution :</p>
<p dir="auto">SEARCH <strong><code>(?-is)\R(?=(?!&lt;CLT 4&gt;).+&lt;CLT&gt;$)</code></strong></p>
<p dir="auto">REPLACE <strong><code>\x20</code></strong></p>
<hr />
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">First, the <strong>in-line</strong> modifiers <strong><code>(?-si)</code></strong> :</p>
<ul>
<li>
<p dir="auto">Forces to regex <strong>engine</strong> to interpret any <strong>dot</strong> ( <strong><code>.</code></strong> ) as representing a  <strong>single standard</strong> character only, <strong>NOT EOL</strong> character(s)</p>
</li>
<li>
<p dir="auto">Forces the search to be processed in a <strong>non-insensitive</strong> way</p>
</li>
</ul>
</li>
<li>
<p dir="auto">Then, the <strong><code>\R</code></strong> syntax will match any <strong>EOL</strong> ( <strong><code>\r\n</code></strong> in <strong>Windows</strong> files, <strong><code>\n</code></strong> in <strong>Unix</strong> files and <strong><code>\r</code></strong> in <strong>Mac</strong> files )</p>
</li>
<li>
<p dir="auto">But <em>only if</em>  the <strong>look-ahead</strong> - condition <strong><code>(?=.+&lt;CLT&gt;$)</code></strong> is <strong>true</strong>, i.e. if the <strong>following</strong> line ends with the string <strong><code>&lt;CLT&gt;</code></strong></p>
</li>
<li>
<p dir="auto">And <em>only if</em>  the second <strong>negative nested</strong> look-ahead <strong><code>(?!&lt;CLT 4&gt;)</code></strong>, right after <strong><code>\R</code></strong>, is also <strong>true</strong>, i.e. the <strong>following</strong> line does <strong>not</strong> begin with the string <strong><code>&lt;CLT 4&gt;</code></strong></p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy38</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44661</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44661</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 19 Jun 2019 11:59:09 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Wed, 19 Jun 2019 03:27: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><br />
Since you’re already here, quick unrelated question - since this was formatted for a certain aesthetic, sentences cut off and continue on a new line past a certain point.<br />
Like:<br />
&lt;CLT 4&gt;The entrance is still blocked by that giant hunk of<br />
metal.&lt;CLT&gt;<br />
Would there be any way to find and replace those line breaks? I’m using some direct quotes from the transcript in my writings, and it’d save a lot of frustration to auto-format them instead of doing it manually for every single dialogue that goes on for more than a line. So it’d look like this:<br />
&lt;CLT 4&gt; The entrance is still blocked by that giant hunk of metal. &lt;CLT&gt;</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44660</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44660</guid><dc:creator><![CDATA[Joey Flaig]]></dc:creator><pubDate>Wed, 19 Jun 2019 03:27:19 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Wed, 19 Jun 2019 02:46:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> Thank you for the insight!</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a>  And omg this did all 5,145 instances with one click… You just saved me HOURS (days if it weren’t for find and replace) of work! Thank you so completely much!!! Now I can process the rest of the transcript easy as pie too!!! &lt;3</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44659</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44659</guid><dc:creator><![CDATA[Joey Flaig]]></dc:creator><pubDate>Wed, 19 Jun 2019 02:46:21 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Tue, 18 Jun 2019 08:11:01 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/joey-flaig" aria-label="Profile: joey-flaig">@<bdi>joey-flaig</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: ekopalypse">@<bdi>ekopalypse</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Ah, perfect and… sorry for my demand for <strong>additional</strong> information ! As, finally, you do want what you spoke about, in your <strong>initial</strong> post, i.e to <strong>delete all</strong> the lines from <strong><code>&lt;ORIGINAL N°###&gt;</code></strong> to <strong><code>&lt;/COMMENT N°###&gt;</code></strong>, for <strong>each</strong> dialogue ;-))</p>
<p dir="auto">Then, the <strong>right</strong> regex S/R is obvious :</p>
<ul>
<li>
<p dir="auto">Open the <strong>Replace</strong> dialog ( <strong><code>Ctrl + H</code></strong> )</p>
</li>
<li>
<p dir="auto">Type in the regex <strong><code>(?s-i)^\h*&lt;/ORIGINAL\x20N°(\d+)&gt;.+?&lt;/COMMENT\x20N°\1&gt;\R</code></strong>, in the <strong>Find what:</strong> zone</p>
</li>
<li>
<p dir="auto">Leave the <strong>Replace with:</strong> <strong><code>EMPTY</code></strong></p>
</li>
<li>
<p dir="auto">Preferably tick the <strong><code>Wrap around</code></strong> option</p>
</li>
<li>
<p dir="auto">Choose the <strong><code>Regular expression</code></strong> search mode</p>
</li>
<li>
<p dir="auto">Click <strong>once</strong> on the <strong><code>Replace All</code></strong> button, or <strong>several</strong> times on the <strong><code>Replace</code></strong> button</p>
</li>
</ul>
<p dir="auto">Et voilà !</p>
<hr />
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">First, the <strong>in-line</strong> modifiers <strong><code>(?s-i)</code></strong> :</p>
<ul>
<li>
<p dir="auto">Forces to regex engine to interpret any <strong>dot</strong> ( <strong><code>.</code></strong> ) as representing any <strong>single</strong> character, even <strong>EOL</strong> characters</p>
</li>
<li>
<p dir="auto">Forces the search to be processed in a <strong>non-insensitive</strong> way</p>
</li>
</ul>
</li>
<li>
<p dir="auto">Then, the part <strong><code>^\h*&lt;/ORIGINAL\x20N°(\d+)&gt;</code></strong> looks for the string <strong>&lt;/ORIGINAL N°</strong>, in that <strong>exact</strong> case, both <strong>preceded</strong> with possible horizontal blank chars ( <strong><code>\h*</code></strong> ) and <strong>followed</strong> with some non-null range of digits, which is stored as <strong>group <code>1</code></strong>, due to the <strong>enclosed</strong> parentheses ( <strong><code>(\d+)</code></strong> ), and finally followed with the <strong><code>&gt;</code></strong> character</p>
</li>
<li>
<p dir="auto">Now the last part <strong><code>&lt;/COMMENT\x20N°\1&gt;\R</code></strong> searches for the string <strong>&lt;/COMMENT N°</strong>, in that <strong>exact</strong> case, <strong>followed</strong> with the contents of <strong>group<code>1</code></strong> ( <strong><code>\1</code></strong> = the number of <strong>each</strong> dialogue ) and the <strong>EOL</strong> character(s) of the line ( <strong><code>\R</code></strong> )</p>
</li>
<li>
<p dir="auto">The middle part <strong><code>.+?</code></strong>, represents the <strong>smallest non null</strong> range of <strong>any</strong> character between the <strong>first</strong> part and <strong>last</strong> part matchs</p>
</li>
<li>
<p dir="auto">As the <strong>replacement</strong> zone is <strong><code>EMPTY</code></strong>, any <strong>multi-lines</strong> block <strong><code>&lt;ORIGINAL N°###&gt;</code></strong>…<strong><code>&lt;/COMMENT N°###&gt;</code></strong> is then <strong>deleted</strong></p>
</li>
</ul>
<p dir="auto">Best regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44610</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44610</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 18 Jun 2019 08:11:01 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Tue, 18 Jun 2019 03:33:42 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">Since the game is an English localization, they included the original Japanese text. There’s also a lot of things that start with &lt;/ that I don’t need – I’m not using any style or formatting, just the English text itself. So I only want to keep lines 1 - 4 and delete lines 5 - 13 for the ‘giant hunk of metal’ dialogue.  Some of the dialogue goes more or less than two lines though so it can’t just be based on line numbers, if that makes sense?  For example, the ‘mailbox doesn’t seem important’ dialogue I want to delete lines 4 - 13.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44606</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44606</guid><dc:creator><![CDATA[Joey Flaig]]></dc:creator><pubDate>Tue, 18 Jun 2019 03:33:42 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Mon, 17 Jun 2019 21:50:30 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/joey-flaig" aria-label="Profile: joey-flaig">@<bdi>joey-flaig</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: ekopalypse">@<bdi>ekopalypse</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Welcome to the <strong><code>Notepad++ Comunity</code></strong> !</p>
<p dir="auto">Of course, the <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: ekopalypse">@<bdi>ekopalypse</bdi></a> solutions work but, to my mind, <strong>Joey</strong>, the fact of deleting from <strong><code>&lt;/ORIGINAL N°###&gt;</code></strong> till <strong><code>&lt;/COMMENT N°00#&gt;</code></strong> does not seem <strong>logic</strong> !</p>
<p dir="auto">Because, either, you want to delete <strong>all</strong> the block :</p>
<pre><code class="language-xml">&lt;ORIGINAL N°###&gt;
&lt;CLT 4&gt;The entrance is still blocked by that giant hunk of
metal.&lt;CLT&gt;
&lt;/ORIGINAL N°###&gt;
</code></pre>
<p dir="auto">Or you prefer to <strong>keep</strong> it and <strong>delete</strong> from the <strong>following</strong> line <strong><code>&lt;JAPANESE N°001&gt;</code></strong> till the line <strong><code>&lt;/COMMENT N°00#&gt;</code></strong>, <strong>included</strong> ?</p>
<p dir="auto">So, could you specify, with the <strong>sample</strong> text below, which are, exactly, the <strong>numbers</strong> of the lines that you wish to <strong>delete</strong>  ?</p>
<pre><code class="language-diff"> 1  &lt;SPEAKER N°001&gt;MAKOTO NAEGI&lt;/SPEAKER N°###&gt;
 2  &lt;ORIGINAL N°###&gt;
 3  &lt;CLT 4&gt;The entrance is still blocked by that giant hunk of
 4  metal.&lt;CLT&gt;
 5  &lt;/ORIGINAL N°###&gt;
 6  &lt;JAPANESE N°###&gt;
 7  &lt;CLT 4&gt;入口は…鉄の塊で塞がれてしまっている…&lt;CLT&gt;
 8  &lt;/JAPANESE N°###&gt;
 9  &lt;TRANSLATED N°###&gt;
10  
11  &lt;/TRANSLATED N°###&gt;
12  &lt;COMMENT N°###&gt;
13  &lt;/COMMENT N°###&gt;
</code></pre>
<p dir="auto"><strong>Presently</strong>, I understand that you want the lines <strong><code>5</code></strong> to <strong><code>13</code></strong> to be <strong>deleted</strong>, for each <strong><code>###</code></strong> number !</p>
<p dir="auto">Once the <strong>range</strong> of the lines to be deleted, <strong>clearly</strong> defined, the <strong>appropriate</strong> regex S/R will be easy to build ;-))</p>
<p dir="auto">See you later,</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44598</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44598</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 17 Jun 2019 21:50:30 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Mon, 17 Jun 2019 11:24:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/joey-flaig" aria-label="Profile: Joey-Flaig">@<bdi>Joey-Flaig</bdi></a></p>
<p dir="auto">actually I assume you want to keep the <strong>comment</strong> tag intact which means instead<br />
of replacing with nothing you might consider using <code>\r\n&lt;COMMENT N°\1&gt;\r\n</code><br />
for replacement. This, in addition, assumes that the line endings are windows eol.<br />
If these are linux eols instead, then use <code>\n&lt;COMMENT N°\1&gt;\n</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/44588</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44588</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 17 Jun 2019 11:24:41 GMT</pubDate></item><item><title><![CDATA[Reply to Finding and replacing all data between two points? on Mon, 17 Jun 2019 11:13:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/joey-flaig" aria-label="Profile: Joey-Flaig">@<bdi>Joey-Flaig</bdi></a></p>
<p dir="auto">you can use <strong>Mark All</strong> to see what gets replaced.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/44587</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/44587</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 17 Jun 2019 11:13:19 GMT</pubDate></item></channel></rss>