<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[RegEx help needed]]></title><description><![CDATA[<p dir="auto">Hello, I need help with a RegEx.</p>
<p dir="auto">I have to do a translation in a source text that is in the following place after [text “:”] and ends with ".<br />
Here is an example:</p>
<pre><code>"English_pd_pTag_1":"","English_pd_comSize_1":2,"English_pd_sprite_1":"","English_pd_1_com_0text":"Look in her phone.","English_pd_1_com_0audio":"","English_pd_1_com_0sprite":"",
"English_pd_1_com_1text":"Na, I shouldn't, I'll give it back to her.","English_pd_1_com_1audio":"","English_pd_1_com_1sprite":"",
"English_pd_pTag_2":"","English_pd_comSize_2":2,"English_pd_sprite_2":"","English_pd_2_com_0text":"Okay, just in case, I'll send it to my phone and delete the message.","English_pd_2_com_0audio":"","English_pd_2_com_0sprite":"",
"English_pd_2_com_1text":"Do nothing, and give it back to her.","English_pd_2_com_1audio":"","English_pd_2_com_1sprite":"",
"English_pd_pTag_3":"","English_pd_comSize_3":2,"English_pd_sprite_3":"","English_pd_3_com_0text":"Look inside the box!",
"English_pd_3_com_0audio":"","English_pd_3_com_0sprite":"","English_pd_3_com_1text":"This could be some Se7en shit, better not look.",
"English_pd_3_com_1audio":"","English_pd_3_com_1sprite":"","English_pd_pTag_4":"","English_pd_comSize_4":2,"English_pd_sprite_4":"","English_pd_4_com_0text":"A batch of money,   like$100 (you miss a scene)","English_pd_4_com_0audio":"","English_pd_4_com_0sprite":"","English_pd_4_com_1text":"Can I drink a little bit of it?","English_pd_4_com_1audio":"","English_pd_4_com_1sprite":"",
"English_pd_pTag_5":"Mom","English_pd_comSize_5":1,"English_pd_sprite_5":"","English_pd_5_com_0text":"Hello, my handsome knight! ","English_pd_5_com_0audio":"","English_pd_5_com_0sprite":"",
"English_pd_pTag_6":"Mom","English_pd_comSize_6":1,"English_pd_sprite_6":"","English_pd_6_com_0text":"You can, actually! I've been searching the internet for lovotion but it's sold out everywhere!","English_pd_6_com_0audio":"","English_pd_6_com_0sprite":"",
"English_pd_pTag_7":"Me","English_pd_comSize_7":1,"English_pd_sprite_7":"","English_pd_7_com_0text":"Ah? What's that?","English_pd_7_com_0audio":"","English_pd_7_com_0sprite":"",
</code></pre>
<p dir="auto">Only the text between the quotation marks after the string “text”. " to the next " should be marked.<br />
I have a printout that does this, but not always …<br />
[\ D] [^ _] [^: "] \ s [a-z, A-Z, 0-9,., ', $, (,),!,?,] {1,}</p>
<p dir="auto">Here’s an example:<br />
Lines 2, 9 and 10 are marked correctly.<br />
Some characters are not marked in lines 1, 3, 5, 6 and 8<br />
and in line 4 too much is marked and finally in line 7 once too much (first hit of two) - and once correctly (second hit in the same line).<br />
<img src="/assets/uploads/files/1576937170928-npp-regex.jpg" alt="NPP RegEx.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">I hope I have not expressed myself too incomprehensibly and someone can help me with this problem …</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/18656/regex-help-needed</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Jul 2026 09:30:47 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/18656.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 21 Dec 2019 14:09:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to RegEx help needed on Sun, 22 Dec 2019 00:34:35 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/hans-dampf" aria-label="Profile: hans-dampf">@<bdi>hans-dampf</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/andrecool-68" aria-label="Profile: andrecool-68">@<bdi>andrecool-68</bdi></a> and <strong>All</strong>,</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hans-dampf" aria-label="Profile: hans-dampf">@<bdi>hans-dampf</bdi></a>, I <strong>strongly</strong> advice you to <strong>study</strong> the regexes’s world , beginning with the <strong>excellent</strong> tutorial of the <strong><a href="http://Regular-Expressions.info" rel="nofollow ugc">Regular-Expressions.info</a></strong> site, below :</p>
<p dir="auto"><a href="https://www.regular-expressions.info/tutorialcnt.html" rel="nofollow ugc">https://www.regular-expressions.info/tutorialcnt.html</a></p>
<p dir="auto">It will certainly take you a <strong>few</strong> weeks to get an <strong>overview</strong> of the syntax of <strong>regular</strong> expressions, but it’s <strong>really</strong> worth it. ;-))</p>
<p dir="auto">If you are in a <strong>hurry</strong>, see this part :</p>
<p dir="auto"><a href="https://www.regular-expressions.info/shorthand.html" rel="nofollow ugc">https://www.regular-expressions.info/shorthand.html</a></p>
<hr />
<p dir="auto">Moreover, regarding your <strong>second</strong> regex construction <strong><code>(?&lt;=text":")*(",")</code></strong>, this syntax seems <strong>incorrect</strong> as the quantifier <strong><code>*</code></strong>, meaning <strong><code>repeated 0 or more times</code></strong> should be, either, <strong>preceded</strong> with a character, like <strong><code>s*</code></strong>, an expression embedded with <strong>parentheses</strong> like <strong><code>(123)*</code></strong>, a character class, like <strong><code>[abc]*</code></strong> or a shorthand class, like <strong><code>\h*</code></strong>. But, it should <strong>not</strong> follow a <strong>look-behind</strong> construction !</p>
<p dir="auto">However, I was really surprised that our <strong>Boost</strong> regex engine does <strong>not</strong> consider it as <strong>invalid</strong> !?</p>
<p dir="auto">To explain this behavior, let us, first, consider the simple regex <strong><code>(?&lt;=abc)def</code></strong> which searches for the string <strong>def</strong> <em>only if</em>  preceded with the string <strong>abc</strong>. If you add the same look-behind, giving the regex <strong><code>(?&lt;=abc)(?&lt;=abc)def</code></strong> it will do the <strong>same</strong> search, because <strong>look-arounds</strong> are just <strong>zero-length</strong> assertions and because they <strong>both</strong> refer about the <strong>same</strong> condition !</p>
<p dir="auto">You could add as many <strong>identical</strong> look-behind to get the same result ( For instance <strong><code>(?&lt;=abc)(?&lt;=abc)(?&lt;=abc)(?&lt;=abc)(?&lt;=abc)def</code></strong> would match any string <strong>def</strong>, if <strong>preceded</strong> with the string <strong>abc</strong> ! )</p>
<p dir="auto">Indeed, the <strong><code>*</code></strong>, right <strong>after</strong> the look-behind, is taken as a <strong>real</strong> quantifier. As <strong>consecutive</strong> values are useless, the unique <strong>interesting</strong> case seems to be <strong><code>(?&lt;=abc)?def</code></strong> which would search for the string <strong>def</strong> OR for the string <strong>def</strong> <em>only if</em>  preceded with the string <strong>abc</strong>. Of course, due to <strong>Boole</strong> algebra, this regex could just be <strong>simplified</strong> as the search of <strong><code>def</code></strong> ;-))</p>
<p dir="auto">To be <strong>convinced</strong> you of that fact, consider the text, below :</p>
<pre><code class="language-z">1 ","
2 text":"","
3 ABCD":"","
</code></pre>
<ul>
<li>
<p dir="auto">The regexes <strong><code>","</code></strong> or <strong><code>(?&lt;=text":")*","</code></strong> or <strong><code>(?&lt;=text":")?","</code></strong> would find the string <strong><code>","</code></strong>, in the <strong>three</strong> lines</p>
</li>
<li>
<p dir="auto">The regexes <strong><code>(?&lt;=text":")","</code></strong> or <strong><code>(?&lt;=text":")+","</code></strong> or <strong><code>(?&lt;=text":"){1}","</code></strong> or <strong><code>(?&lt;=text":"){10}","</code></strong> would find the string <strong><code>","</code></strong> in line <strong><code>2</code></strong> <strong>only</strong></p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49397</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49397</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 22 Dec 2019 00:34:35 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx help needed on Sat, 21 Dec 2019 23:02:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hans-dampf" aria-label="Profile: Hans-Dampf">@<bdi>Hans-Dampf</bdi></a></p>
<blockquote>
<p dir="auto">I read that “\ D” stands for letters</p>
</blockquote>
<p dir="auto">No <code>\D</code> stands for a non-digit.  <code>\d</code> stands for a digit, and is the same as <code>[0-9]</code>.  Thus <code>\D</code> would match anything but <code>0123456789</code>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49396</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49396</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 21 Dec 2019 23:02:55 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx help needed on Sat, 21 Dec 2019 19:46:22 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/49392">RegEx help needed</a>:</p>
<blockquote>
<p dir="auto">I’m not sure what to make of your expression, except to say that “You tried!” :-)</p>
</blockquote>
<p dir="auto">I try to learn and understand what I’m doing … ;-)</p>
<blockquote>
<p dir="auto">The oddest part of your expression might be <code>\D</code> which means “match anything except a digit”.</p>
</blockquote>
<p dir="auto">I read that “\ D” stands for letters …<br />
With the flag \ D, I got this output:<br />
<img src="/assets/uploads/files/1576957484840-npp-regex2.jpg" alt="NPP RegEx2.jpg" class=" img-fluid img-markdown" /><br />
Without \ D  only this:<br />
<img src="/assets/uploads/files/1576957493261-npp-regex3.jpg" alt="NPP RegEx3.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/49395</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49395</guid><dc:creator><![CDATA[Hans Dampf]]></dc:creator><pubDate>Sat, 21 Dec 2019 19:46:22 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx help needed on Sat, 21 Dec 2019 17:32:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hans-dampf" aria-label="Profile: Hans-Dampf">@<bdi>Hans-Dampf</bdi></a></p>
<p dir="auto"><code>\K</code> is kind of a “start again” flag.  What comes to the left has to match, but it isn’t part of the match.  The matched text is only what appears to the right of the final <code>\K</code> in an expression.</p>
<p dir="auto">I’m not sure what to make of your expression, except to say that “You tried!” :-)</p>
<p dir="auto">The oddest part of your expression might be <code>\D</code> which means “match anything except a digit”.</p>
<p dir="auto">We have more info about regular expressions by following this link:<br />
<a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regex-documentation">https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regex-documentation</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/49392</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49392</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 21 Dec 2019 17:32:44 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx help needed on Sat, 21 Dec 2019 16:30:40 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/49387">RegEx help needed</a>:</p>
<blockquote>
<p dir="auto">(?-is)text":“\K.+?(?=”)</p>
</blockquote>
<p dir="auto">Oh wow!<br />
It works!<br />
Many, many thanks and a Merry Christmas time!</p>
<p dir="auto">I have a question about the \ K. +? flag …<br />
If they were kind enough to explain it briefly so that I can understand it better.<br />
I had already found a partial solution myself, but in the end it was “.” selected with.<br />
(? &lt;= Text “:”) \ D * (")</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49391</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49391</guid><dc:creator><![CDATA[Hans Dampf]]></dc:creator><pubDate>Sat, 21 Dec 2019 16:30:40 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx help needed on Sat, 21 Dec 2019 15:25:52 GMT]]></title><description><![CDATA[<p dir="auto">In order to localize such lines, I would do all the formatting in one column (this will be more readable)<br />
After localization, combined all the lines (as it was originally)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/49388</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49388</guid><dc:creator><![CDATA[andrecool-68]]></dc:creator><pubDate>Sat, 21 Dec 2019 15:25:52 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx help needed on Sat, 21 Dec 2019 15:22:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hans-dampf" aria-label="Profile: Hans-Dampf">@<bdi>Hans-Dampf</bdi></a> :</p>
<p dir="auto">You expressed yourself well.</p>
<p dir="auto">How about trying to search for <code>(?-is)text":"\K.+?(?=")</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/49387</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/49387</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 21 Dec 2019 15:22:58 GMT</pubDate></item></channel></rss>