<?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[Need help with adding  to the end of multiple different strings.]]></title><description><![CDATA[<p dir="auto">Need help with adding &lt;/i&gt; to the end of multiple different strings.<br />
Hoping for a solution that could do all?</p>
<p dir="auto">BEFORE:</p>
<pre><code>454
00:42:34,466 --&gt; 00:42:37,010
- Temperature's good.
- &lt;i&gt;Yeah.

466
00:44:40,050 --&gt; 00:44:43,928
- &lt;i&gt;How's his pulse?
- RUDENKO: It's high. Not to worry too much.

467
00:44:43,929 --&gt; 00:44:47,306
MAXIM: &lt;i&gt;Hey, do you speak any Russian?
CURNOW: &lt;i&gt;No.

468
00:44:47,307 --&gt; 00:44:50,476
MAXIM: &lt;i&gt;That's okay. I speak English well.

470
00:44:51,687 --&gt; 00:44:56,023
FLOYD: &lt;i&gt;Hey, Curnow, have you heard the one
about the marathon runner and the chicken?
</code></pre>
<p dir="auto">AFTER:</p>
<pre><code>454
00:42:34,466 --&gt; 00:42:37,010
- Temperature's good.
- &lt;i&gt;Yeah.&lt;/i&gt;

466
00:44:40,050 --&gt; 00:44:43,928
- &lt;i&gt;How's his pulse?&lt;/i&gt;
- RUDENKO: It's high. Not to worry too much.

467
00:44:43,929 --&gt; 00:44:47,306
MAXIM: &lt;i&gt;Hey, do you speak any Russian?&lt;/i&gt;
CURNOW: &lt;i&gt;No.&lt;/i&gt;

468
00:44:47,307 --&gt; 00:44:50,476
MAXIM: &lt;i&gt;That's okay. I speak English well.&lt;/i&gt;

470
00:44:51,687 --&gt; 00:44:56,023
FLOYD: &lt;i&gt;Hey, Curnow, have you heard the one
about the marathon runner and the chicken?&lt;/i&gt;
</code></pre>
<p dir="auto">Here are my attempts at trying to solve with no joy.</p>
<pre><code>Find 1:		&lt;i&gt;([A-Za-z0-9 \.',"-:!?]+)\R([A-Za-z0-9 \.',"-:!?]+)\R\h
Replc 1:	&lt;i&gt;$1\r\n$2&lt;/i&gt;\r\n

Find 2:		&lt;i&gt;([A-Za-z0-9 \.',"-:!?]+)\R\h
Replc 2:	&lt;i&gt;$1&lt;/i&gt;\r\n
</code></pre>
<p dir="auto">Thanks in advanced for any help with this, Hank</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/25265/need-help-with-adding-i-to-the-end-of-multiple-different-strings</link><generator>RSS for Node</generator><lastBuildDate>Tue, 13 Oct 2026 23:14:50 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/25265.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 19 Dec 2023 14:24:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Need help with adding  to the end of multiple different strings. on Thu, 21 Dec 2023 11:58:53 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">Paste the following text in a new tab … Each line is repeated with the 3 possible line-breaks ( \r\n, \n, and \r )</p>
</blockquote>
<p dir="auto">For me, at least, the line ending types indicated didn’t carry over in the copy, that is, I got this:</p>
<p dir="auto"><img src="/assets/uploads/files/1703159838604-b57e3295-ffa2-4686-aaa5-caaf59887fdf-image.png" alt="b57e3295-ffa2-4686-aaa5-caaf59887fdf-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">It’s not really a problem, but to carry on from that point to replicate what <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> is testing, one should manually adjust the line-endings before continuing.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/91370</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91370</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 21 Dec 2023 11:58:53 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with adding  to the end of multiple different strings. on Wed, 20 Dec 2023 16:14:42 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <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">Regarding the mix of <strong>special</strong> chars, in lines, which can be <strong>wrongly</strong> interpreted as <strong>line-ending</strong> chars, I improved my <strong>previous</strong> regex about :</p>
<ul>
<li>
<p dir="auto">The way to catch <strong>all</strong> the line contents of <strong>any</strong> complete line, wrapped or <strong>not</strong>, whatever its <strong>line-ending</strong> char(s), even <strong>none</strong></p>
</li>
<li>
<p dir="auto">The way to catch the <strong>true</strong> <strong><code>$</code></strong> assertion, which represents the <strong>very end</strong> of <strong>any</strong> line, <strong>empty</strong> or <strong>not</strong></p>
</li>
</ul>
<hr />
<p dir="auto">SEARCH / MARK <strong><code>(?s)^(?:[^\r\n]+?|(?&lt;![\x{000C}\x{0085}\x{2028}\x{2029}]))(?=\r\n|\r|\n|\z)</code></strong></p>
<p dir="auto">The contents of <strong>each</strong> line is stored as <strong>group</strong> <strong><code>0</code></strong>, which can be <strong>re-used</strong>, in the <strong>replacement</strong> part, with the <strong><code>$0</code></strong> syntax</p>
<p dir="auto">SEARCH / MARK <strong><code>(?s)^(?:[^\r\n]+?|(?&lt;![\x{000C}\x{0085}\x{2028}\x{2029}]))\K(?=\r\n|\r|\n|\z)</code></strong></p>
<p dir="auto">This <strong>second</strong> regex gives the <strong>zero-length</strong> location of the <strong>very end</strong> of <strong>each</strong> line, <strong>empty</strong> or <strong>not</strong>, whatever its <strong>line-ending</strong> char(s), even <strong>none</strong></p>
<hr />
<p dir="auto">I added some tests when <strong>special</strong> chars are <strong>alone</strong> or <strong>begin</strong> or <strong>end</strong> the current line, and this for the <strong><code>3</code></strong> <strong>line-end</strong> syntaxes ( <strong><code>\r\n</code></strong>, <strong><code>\n</code></strong> and <strong><code>\r</code></strong> ), giving the <em>INPUT</em> text, below, which should work in <strong>all</strong> cases :</p>
<pre><code class="language-diff">


a
a
a






 
 
 
 
 
 
az
az
az
a z
a z
a z
a z
a z
a z
az
az
az
z
z
z
 z
 z
 z
 z
 z
 z
z
z
z
a
a
a
a 
a 
a 
a 
a 
a 
a
a
a
</code></pre>
<p dir="auto">Just test my <strong>two new</strong> regexes against this <em>INPUT</em> text !</p>
<p dir="auto">Best Regards</p>
<p dir="auto">guy038</p>
<p dir="auto"><strong>P.S.</strong> :</p>
<p dir="auto">With the <strong>free-spacing</strong> mode, the <strong>first</strong> regex becomes :</p>
<p dir="auto">SEARCH / MARK <strong><code>(?xs) ^ (?: [^\r\n]+? | (?&lt;! [\x{000C}\x{0085}\x{2028}\x{2029}] ) ) (?= \r\n | \r | \n | \z )</code></strong></p>
<p dir="auto">So, this regex searches, <strong>either</strong>, for :</p>
<ul>
<li>
<p dir="auto">The <strong>smallest</strong> range of characters, <strong>different</strong> from <strong><code>\r</code></strong> and <strong><code>\n</code></strong>, after <strong>beginning</strong> of current line, till the <strong>line-ending</strong> char(s) or the <strong>very end</strong> of file</p>
</li>
<li>
<p dir="auto">A <strong>zero-length</strong> string, at <strong>beginning</strong> of current line, <strong>not</strong> preceded by any of these <strong>four</strong> chars <strong><code>\x{00OC}</code></strong>, <strong><code>\x{0085}</code></strong>, <strong><code>\x{2028}</code></strong> and <strong><code>\x{2029}</code></strong> and followed with any <strong>line-ending</strong> char(s) or by the <strong>very end</strong> of file</p>
</li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/91359</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91359</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 20 Dec 2023 16:14:42 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with adding  to the end of multiple different strings. on Tue, 19 Dec 2023 22:21:21 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/hank-k" aria-label="Profile: hank-k">@<bdi>hank-k</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"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>, I was <strong>upset</strong> because I <strong>initially</strong> thought that your <strong>two consecutive</strong> conditions should be interpreted as <strong><code>IF(NOT (A))</code></strong> OR <strong><code>IF(NOT (B))</code></strong>, and I was <strong>perplex</strong> as my regex was interpreted as <strong><code>IF NOT ((A) OR (B))</code></strong> and I know, because of the <strong>Morgan’s laws</strong>, that one of the two should be <strong>false</strong> !</p>
<p dir="auto">Luckily, I was <strong>wrong</strong>. Your regex must be interpreted as <strong><code>IF (NOT (A)) AND IF (NOT (B))</code></strong>, because <strong>each</strong> condition must be <strong>true</strong>, right after the <strong>line-break</strong> ! And, of course, you’re right : it’s just the <strong>two</strong> forms of the <strong>same</strong> logical concept :-)</p>
<hr />
<p dir="auto">Now, regarding the necessity to add the <strong><code>$</code></strong> assertion or <strong>not</strong>, I did some tests and the problem seems <strong>quite</strong> difficult !</p>
<p dir="auto"><strong>Paste</strong> the following text in a <strong>new</strong> tab :</p>
<pre><code>


a
a
a
az
az
az
a z
a z
a z
a z
a z
a z
az
az
az
</code></pre>
<p dir="auto">In this text :</p>
<ul>
<li>
<p dir="auto"><strong>Each</strong> line is repeated with the <strong><code>3</code></strong> possible <strong>line-breaks</strong> ( <strong><code>\r\n</code></strong>, <strong><code>\n</code></strong>, and <strong><code>\r</code></strong> )</p>
</li>
<li>
<p dir="auto">We have, successively, <strong><code>3</code></strong> <strong>empty</strong> lines, <strong><code>3</code></strong> chars <strong>a</strong>, <strong><code>3</code></strong> strings <strong>aFFz</strong>, <strong><code>3</code></strong> strings <strong>aLSz</strong>, <strong><code>3</code></strong> strings <strong>aPSz</strong> and <strong><code>3</code></strong> strings <strong>aNELz</strong></p>
</li>
</ul>
<hr />
<p dir="auto">Just test the search of <strong><code>$</code></strong> against these lines : after the <strong>first six</strong> lines <strong>correctly</strong> detected, the regex matches a <strong>null length</strong> after, both, the <strong><code>a</code></strong> letter and the <strong><code>z</code></strong> letter</p>
<p dir="auto">To my mind, a <strong>correct</strong> regex to grasp <strong>all</strong> the characters of a line and thus, <strong>all</strong> the chars till the <strong>very end</strong> of each line, could be :</p>
<ul>
<li>SEARCH/MARK <strong><code>(?s)^([^\r\n]+?|)(?=\r\n|\r|\n)</code></strong></li>
</ul>
<p dir="auto">And, in order to get the <strong>very end</strong> of these lines, we would use the regex :</p>
<ul>
<li>SEARCH/MARK <strong><code>(?s)^([^\r\n]+?|)(?=\r\n|\r|\n)\K</code></strong></li>
</ul>
<hr />
<p dir="auto">As you see, these formulations are <strong>not</strong> obvious too !</p>
<p dir="auto">In fact, the simple <strong><code>$</code></strong> regex matches <strong>any</strong> position <strong>right before</strong> the <strong><code>CR</code></strong>, <strong><code>LF</code></strong>, <strong><code>FF</code></strong>, <strong><code>LS</code></strong>, <strong><code>PS</code></strong> or <strong><code>NEL</code></strong> character</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/91352</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91352</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 19 Dec 2023 22:21:21 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with adding  to the end of multiple different strings. on Tue, 19 Dec 2023 19:03:56 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">Logically (per <a href="https://en.wikipedia.org/wiki/De_Morgan%27s_laws" rel="nofollow ugc">De Morgan’s Laws</a>), <code>NOT(A OR B)</code> is identical to <code>NOT(A) AND NOT(B)</code>.  Neither one is logically “simpler” or “harder”; they are just alternate formulations of the same logical concept.  An individual might more naturally think in terms of one or the other, but they are the same thing.  In this case, because of the way I was building it up to try to help the original poster understand, I thought it best to keep it in the same format that I built it up step-by-step in my mind.</p>
<p dir="auto">And I left the ^ and $ in there, again because they were there at an earlier stage in the development process, and there’s no good reason to remove them.  (And in my mind, they help distinguish between “the end of the logical line” <code>$</code> and “the separator character(s) that goes between one line and the next” <code>\R</code> , so they serve a mental purpose, and have no effect on the final regex.)</p>
<p dir="auto">I am quite willing to have things in alternate formats if it helps me understand or explain a regex better.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/91346</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91346</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 19 Dec 2023 19:03:56 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with adding  to the end of multiple different strings. on Tue, 19 Dec 2023 18:32:51 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/hank-k" aria-label="Profile: hank-k">@<bdi>hank-k</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"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>, I think that we can <strong>shorten</strong> your regex to :</p>
<p dir="auto">SEARCH <strong><code>(?-is)&lt;i&gt;.*(\R(?!- |\u+:).+)?</code></strong></p>
<p dir="auto">REPLACE <strong><code>$0&lt;/i&gt;</code></strong></p>
<ul>
<li>
<p dir="auto">Indeed, the <strong><code>$</code></strong> before <strong><code>\R</code></strong> and the <strong><code>^</code></strong> after <strong><code>\R</code></strong> are <strong>useless</strong></p>
</li>
<li>
<p dir="auto">The <strong>two</strong> conditions can be <strong>combined</strong> in a <strong>single</strong> look-ahead</p>
</li>
</ul>
<hr />
<p dir="auto">Note that, in your regex, the <strong>conditions</strong> are :</p>
<p dir="auto"><em>IF</em> ( DIFFERENT from <strong><code>-\x20</code></strong> ) at <strong>beginning</strong> of line <em>AND</em> ( <em>IF</em> DIFFERENT from <strong><code>\u+:</code></strong> ) at <strong>beginning</strong> of line :</p>
<p dir="auto">=&gt; Look for the <strong>next</strong> part <strong><code>\R.+</code></strong></p>
<p dir="auto">But, in my regex the <strong>unique</strong> condition is :</p>
<p dir="auto"><em>IF</em> ( DIFFERENT from <strong><code>-\x20</code></strong> <em>OR</em> DIFFERENT from <strong><code>\u+:</code></strong> ) at <strong>beginning</strong> of line :</p>
<p dir="auto">=&gt; Look for the <strong>next</strong> part <strong><code>\R.+</code></strong></p>
<hr />
<p dir="auto">However, these <strong>two</strong> formulations are totally <strong>identical</strong>, because the conditions are <strong>mutually exclusive</strong>.</p>
<p dir="auto">So, <em>ONLY</em> <strong><code>3</code></strong> cases may occur :</p>
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td><strong><code>-\x20</code></strong></td>
<td><strong><code>\u+:</code></strong></td>
<td><strong>Result</strong></td>
<td><strong>Notes</strong></td>
</tr>
<tr>
<td>False</td>
<td>False</td>
<td>MATCH</td>
<td>The regex = <strong><code>(?-is)&lt;i&gt;.*\R.+</code></strong></td>
</tr>
<tr>
<td>False</td>
<td>True</td>
<td><strong>NO</strong> match</td>
<td>The regex = <strong><code>(?-is)&lt;i&gt;.*</code></strong></td>
</tr>
<tr>
<td>True</td>
<td>False</td>
<td><strong>NO</strong> match</td>
<td>The regex = <strong><code>(?-is)&lt;i&gt;.*</code></strong></td>
</tr>
</tbody>
</table>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/91345</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91345</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 19 Dec 2023 18:32:51 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with adding  to the end of multiple different strings. on Tue, 19 Dec 2023 17:37:44 GMT]]></title><description><![CDATA[<p dir="auto">You might find it easier to use <a href="https://www.nikse.dk/subtitleedit" rel="nofollow ugc">Subtitle Edit</a>.</p>
<p dir="auto">One of the options under <strong>Tools</strong> | <strong>Fix common errors…</strong> is <strong>Fix invalid italic tags</strong>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/91341</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91341</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Tue, 19 Dec 2023 17:37:44 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with adding  to the end of multiple different strings. on Tue, 19 Dec 2023 16:30:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hank-k" aria-label="Profile: Hank-K">@<bdi>Hank-K</bdi></a> said in <a href="/post/91337">Need help with adding &lt;/i&gt; to the end of multiple different strings.</a>:</p>
<blockquote>
<p dir="auto">But easy fix afterwards.</p>
</blockquote>
<p dir="auto">Adding in the restriction to <em>not</em> already have the &lt;/i&gt; would make it much more complicated regex.  I think it’s best to just run the one above, then remove any duplicate <code>&lt;/i&gt;&lt;/i&gt;</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/91338</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91338</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 19 Dec 2023 16:30:36 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with adding  to the end of multiple different strings. on Tue, 19 Dec 2023 16:23:50 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><br />
I forgot to mention one issue, which is some of the line strings could already have the &lt;/i&gt;.<br />
In those cases I get double&lt;/i&gt;&lt;/i&gt;.<br />
But easy fix afterwards.<br />
Thanks again.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/91337</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91337</guid><dc:creator><![CDATA[Hank K]]></dc:creator><pubDate>Tue, 19 Dec 2023 16:23:50 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with adding  to the end of multiple different strings. on Tue, 19 Dec 2023 15:55:40 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/91334">Need help with adding &lt;/i&gt; to the end of multiple different strings.</a>:</p>
<blockquote>
<p dir="auto">…</p>
</blockquote>
<p dir="auto">You are TOTALLY correct … my BAD, old age sorry.<br />
This is so AMAZING… thank you so MUCH Peter.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/91335</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91335</guid><dc:creator><![CDATA[Hank K]]></dc:creator><pubDate>Tue, 19 Dec 2023 15:55:40 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with adding  to the end of multiple different strings. on Tue, 19 Dec 2023 15:54:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hank-k" aria-label="Profile: Hank-K">@<bdi>Hank-K</bdi></a> said in <a href="/post/91332">Need help with adding &lt;/i&gt; to the end of multiple different strings.</a>:</p>
<blockquote>
<p dir="auto">It only missed ONE:<br />
…<br />
Oops, it missed this one too:</p>
</blockquote>
<p dir="auto">It didn’t miss either of those for me:</p>
<p dir="auto"><img src="/assets/uploads/files/1703001015404-0c22bfae-82b1-45c2-ad2b-15666e8d3322-image.png" alt="0c22bfae-82b1-45c2-ad2b-15666e8d3322-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Did you have your cursor later in the file and not have Wrap Around checkmarked?</p>
<p dir="auto"><em>addendum: here’s a “before” picture using the Mark tab in the dialog box, to show what it’s going to replace</em><br />
<img src="/assets/uploads/files/1703001262908-02017fb1-3e33-4001-934f-98b7459564ba-image.png" alt="02017fb1-3e33-4001-934f-98b7459564ba-image.png" class=" img-fluid img-markdown" /></p>
<blockquote>
<p dir="auto">I am NO way near understanding</p>
</blockquote>
<p dir="auto">The only way to learn is to study and practice what you’ve been given.  The same is true at 7 or 70</p>
]]></description><link>https://community.notepad-plus-plus.org/post/91334</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91334</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 19 Dec 2023 15:54:35 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with adding  to the end of multiple different strings. on Tue, 19 Dec 2023 15:47:13 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><br />
Your regex is very complex an I am NO way near understanding, that’s why I come here for help. I’m still a noob with regex.<br />
Your regex got the majority which I’m super thankful for.<br />
It only missed ONE:</p>
<pre><code>466
00:44:40,050 --&gt; 00:44:43,928
- &lt;i&gt;How's his pulse?&lt;/i&gt;
- RUDENKO: It's high. Not to worry too much.
</code></pre>
<p dir="auto">I can work with that. Thank you so much for this, much appreciated.<br />
FYI: I’m 70 years old an have a hard time wrapping my head around those complex regex command strings.<br />
Cheers, Hank</p>
]]></description><link>https://community.notepad-plus-plus.org/post/91332</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91332</guid><dc:creator><![CDATA[Hank K]]></dc:creator><pubDate>Tue, 19 Dec 2023 15:47:13 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with adding  to the end of multiple different strings. on Tue, 19 Dec 2023 15:37:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hank-k" aria-label="Profile: Hank-K">@<bdi>Hank-K</bdi></a> said in <a href="/post/91330">Need help with adding &lt;/i&gt; to the end of multiple different strings.</a>:</p>
<blockquote>
<p dir="auto">Not sure I totally understand SHOUTING. Those are the characters names with the following text that is in italics.</p>
</blockquote>
<pre><code class="language-txt">123
11:22:33,444 --&gt; 11:22:34,567
MAXIM: &lt;i&gt;GET OUT OF MY WAY, YOU IDIOT
CURNOW: &lt;i&gt;Hey, calm down, no need to shout.
</code></pre>
<p dir="auto">vs</p>
<pre><code class="language-txt">123
11:22:33,444 --&gt; 11:22:34,567
MAXIM: &lt;i&gt;GET OUT OF MY WAY, YOU IDIOT
CURNOW: I'M STILL TALKING TO YOU
</code></pre>
<p dir="auto">… in the first, MAXIM is shouting at CURNOW, and then CURNOW replies.</p>
<p dir="auto">In the second , MAXIM is still talking to CURNOW on the second line of the paragraph (his whole quote being “GET OUT OF MY WAY, YOU IDIOT CURNOW: I’M STILL TALKING TO YOU”).  It takes true intelligence, not a regex, to understand the difference between those two lines.  Even my regex won’t handle this exception.  But I think my regex comes close enough that it will work under most circumstances.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/91331</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91331</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 19 Dec 2023 15:37:01 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with adding  to the end of multiple different strings. on Tue, 19 Dec 2023 15:30:27 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><br />
Not sure I totally understand SHOUTING. Those are the characters names with the following text that is in italics.<br />
In this case:</p>
<pre><code>467
00:44:43,929 --&gt; 00:44:47,306
MAXIM: &lt;i&gt;Hey, do you speak any Russian?
CURNOW: &lt;i&gt;No.
</code></pre>
<p dir="auto">Both characters are off screen which means both strings need the closing &lt;/i&gt; to produce the following:</p>
<pre><code>467
00:44:43,929 --&gt; 00:44:47,306
MAXIM: &lt;i&gt;Hey, do you speak any Russian?&lt;/i&gt;
CURNOW: &lt;i&gt;No.&lt;/i&gt;
</code></pre>
<p dir="auto">All of what I showed in the BEFORE above in 1st post need the closing &lt;/i&gt;.</p>
<p dir="auto">If two different (or three) FIND/REPLACE are required, that OK.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/91330</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91330</guid><dc:creator><![CDATA[Hank K]]></dc:creator><pubDate>Tue, 19 Dec 2023 15:30:27 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with adding  to the end of multiple different strings. on Tue, 19 Dec 2023 15:30:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hank-k" aria-label="Profile: Hank-K">@<bdi>Hank-K</bdi></a> ,</p>
<p dir="auto">… however, I <em>think</em> this comes pretty close to what you’ll want.</p>
<p dir="auto">FIND = <code>(?-is)&lt;i&gt;.*$(\R^(?!- )(?!\u+:).+)*</code><br />
REPLACE = `$0&lt;/i&gt;</p>
<p dir="auto">Essentially, I started with “match from &lt;i&gt; to the end of the line”, which was easy.  Then I added on "and zero or more subsequent lines if there is any text = <code>(\R.+)*</code> , which then got multi-line paragraphs of speech, but also grabbed too much.  Then I added in “but the extra line cannot start with hyphen-space” using <code>(?!- )</code> (which is a “negative lookahead” saying that it cannot match what’s inside that group), so it stopped capturing those; and then I added “and the extra line cannot start with ALLCAPS-then-colon” with <code>(?!\u+:)</code> .</p>
<p dir="auto">That comes up with the same answer that you said you wanted, so I think it’s good.</p>
<p dir="auto">I tried to explain my methodology: start simple, and then start adding in exceptions.  Because really, figuring out how to do that on your own is the only way to get better at regex.  And anytime we do give you a regex (which likely won’t be many more times), you need to study every little component from there: look up in the documentation below – especially the N++ User Manual link – what each piece of a regex means, and then play around to see how editing that piece will change the results of your matches.</p>
<p dir="auto">-—</p>
<h3>Useful References</h3>
<ul>
<li><a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">Notepad++ Online User Manual: Searching/Regex</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regular-expressions-regex-documentation">FAQ: Where to find other regular expressions (regex) documentation</a></li>
</ul>
<p dir="auto">-—</p>
<p dir="auto"><em><strong>Please note</strong>: This Community Forum is not a data transformation service; you should not expect to be able to always say “I have data like X and want it to look like Y” and have us do all the work for you.  If you are new to the Forum, and new to regular expressions, we will often give help on the first one or two data-transformation questions, especially if they are well-asked and you show a willingness to learn; and we will point you to the documentation where you can learn how to do the data transformations for yourself in the future.  But if you repeatedly ask us to do your work for you, you will find that the patience of usually-helpful Community members wears thin.  The best way to learn regular expressions is by experimenting with them yourself, and getting a feel for how they work; having us spoon-feed you the answers without you putting in the effort doesn’t help you in the long term and is uninteresting and annoying for us.</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/91329</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91329</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 19 Dec 2023 15:30:09 GMT</pubDate></item><item><title><![CDATA[Reply to Need help with adding  to the end of multiple different strings. on Tue, 19 Dec 2023 15:14:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hank-k" aria-label="Profile: Hank-K">@<bdi>Hank-K</bdi></a>,</p>
<blockquote>
<pre><code class="language-txt">467
00:44:43,929 --&gt; 00:44:47,306
MAXIM: &lt;i&gt;Hey, do you speak any Russian?
CURNOW: &lt;i&gt;No.

470
00:44:51,687 --&gt; 00:44:56,023
FLOYD: &lt;i&gt;Hey, Curnow, have you heard the one
about the marathon runner and the chicken?
</code></pre>
</blockquote>
<p dir="auto">The problem is trying to distinguish the “MAXIM” line, where you want it to end after the first line, compared to the “FLOYD” line, where you want the <code>&lt;i&gt;...&lt;/i&gt;</code> to span to the end of the block of text.  Without more knowledge of your edge cases, it’s likely to fail.  For example, if the rule was “&lt;/i&gt; goes on the same line if the next line starts with a capital”, then I could come up with the exception:</p>
<pre><code class="language-txt">470
00:44:51,687 --&gt; 00:44:56,023
FLOYD: &lt;i&gt;Hey, Curnow, have you heard that
George is angry?
</code></pre>
<p dir="auto">… where the next line starts with a capital, but it’s obviously (to a human) not the end of the text that needs &lt;/i&gt;</p>
<p dir="auto">If your rule is “&lt;/i&gt; goes on the same line if the next line starts with ALL CAPS, possibly with hyphen-then-space prefix”, then I would have to ask whether there is ever ANY ALLCAPS SHOUTING in these subtitles?  Because if there is SHOUTING, then there CAN BE a circumstance where it makes it match the regex even though it should be a multiline italics rather than single line.</p>
<p dir="auto">My guess is that for most rules you come up with, I could probably come up with a practical situation in which the natural subtitles will look like they match your rule, but don’t actually match the <em>intent</em> of the rule.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/91328</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/91328</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 19 Dec 2023 15:14:55 GMT</pubDate></item></channel></rss>