<?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[Replacing Duped Words across a block block of text, respecting {}]]></title><description><![CDATA[<p dir="auto">Im looking for a plugin or script that i could run on some 7k Lines, all filled with blocks like this<br />
<code>female_names = { 			Ahiavadevi Apsaradevi Bhogavati Dandi Dandimahadevi Dattadevi Devavati Dharma Dharmamahadevi  			Durlabha Gandharavati Gauri Gaurimahadevi Kalyanavati Karnadevi Kuladevi Lakshmi  			Lakshmikaradevi Lilavati Mahadevi Nayanadevi Rajasundari Ratnavati Suvrata Syamadevi Vakula  			Vakulamahadevi Vasumati Vijnanavati Vijnayavati Yajiyavati Yajnavati Giriraj Kumari Suratarangini Devi  			Krishnapriya Bishnupriya Tikayet Devi 		}</code><br />
…<br />
<code>female_names = { 			Ahiavadevi Apsaradevi Bhogavati Dandi Dandimahadevi Dattadevi Devavati Dharma Dharmamahadevi  			Durlabha Gandharavati Gauri Gaurimahadevi Kalyanavati Karnadevi Kuladevi Lakshmi  			Lakshmikaradevi Lilavati Mahadevi Nayanadevi Rajasundari Ratnavati Suvrata Syamadevi Vakula  			Vakulamahadevi Vasumati Vijnanavati Vijnayavati Yajiyavati Yajnavati Giriraj Kumari Suratarangini Devi  			Krishnapriya Bishnupriya Tikayet Devi 		}</code></p>
<p dir="auto">that finds all the duplicates within a given { } potentially on different lines (and sometimes in quotes, EG “De jure”) but again treats each block as unique, in this case the only dups are Devi in each block, and only the extra within its block is removed</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/15247/replacing-duped-words-across-a-block-block-of-text-respecting</link><generator>RSS for Node</generator><lastBuildDate>Thu, 21 May 2026 10:22:11 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/15247.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 11 Feb 2018 10:37:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Sat, 24 Feb 2018 20:43:54 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <strong>Marc</strong> and <strong>All</strong>,</p>
<p dir="auto">IMHO, I supposed that your <strong>current</strong> file contains <strong>too much</strong> data ! I, very often, verified that <strong>complicated</strong> regexes <strong>totally</strong> fail when applied to <strong>huge</strong> amounts of text with the result that, only, <strong>one wrong</strong> match of <strong>all</strong> the file <strong>contents</strong>, occurs :-((</p>
<p dir="auto">May be, try to <strong>slice</strong> your file in <strong>smaller</strong> parts ! It could help ?!</p>
<p dir="auto">Generally, this problem often occurs when using <strong>recursion</strong> feature in regexes. But, it’s quite <strong>difficult</strong> to fully understand the <strong>limitations</strong> of the <strong>Boost</strong> regex engine, used in N++ !</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30551</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30551</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 24 Feb 2018 20:43:54 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Sat, 24 Feb 2018 19:56:10 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> For some reason this script has stopped working for me… its now just wiping the entire file.</p>
<p dir="auto">Find what : (?si)(?:^|\h+)(“?)['.,]?(\w[\w '.-]<em>\w)['.,]?\1(?=(?:\h+|\R)(?:[^{}]</em>(?:\h+|\R))?(”?)[‘.,]?\2[’.,]?\3(?:\h|\R))<br />
replacing with nothing</p>
<p dir="auto">wrap around<br />
regular expression</p>
<p dir="auto">and its blanking the file… (replace all: 1 occurrence was replaced)</p>
<hr />
<p dir="auto">nvm ?..? seems a extra space worked into the code…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30549</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30549</guid><dc:creator><![CDATA[Marc Lalonde]]></dc:creator><pubDate>Sat, 24 Feb 2018 19:56:10 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Mon, 12 Feb 2018 22:36:12 GMT]]></title><description><![CDATA[<p dir="auto">Since i finished my files, I just took the main original version and first ran it though the validator, 1876 errors, after running the script over it and validator. It got every single one. Only one Minor minor issue that doesn’t really have to be fixed, is it strips the last two closing } brackets at the very end of the file, that takes all of 5 seconds to re-add, i consider this a completed script. I very much appreciate the help for the last 24 hours, it probably saved me double if not more.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30249</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30249</guid><dc:creator><![CDATA[Marc Lalonde]]></dc:creator><pubDate>Mon, 12 Feb 2018 22:36:12 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Mon, 12 Feb 2018 21:38:17 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/marc-lalonde" aria-label="Profile: marc-lalonde">@<bdi>marc-lalonde</bdi></a>,</p>
<p dir="auto">OK ! So, I changed the part of the regex , <strong><code>(\w[\w '-]*\w)</code></strong>, responsible of matching the <strong>name</strong>, that is to be <strong>deleted</strong>. The new regex is <strong><code>['.,]?(\w[\w '.-]*\w)['.,]?</code></strong>, which means that a <strong>name</strong> :</p>
<ul>
<li>
<p dir="auto">Begins with a <strong>word</strong> character, possibly <strong>preceded</strong> by an <strong>apostrophe</strong> ( <strong><code>'</code></strong> ), a <strong>dot</strong> ( <strong><code>.</code></strong> ) or a <strong>comma</strong> (<strong><code>,</code></strong>) symbols</p>
</li>
<li>
<p dir="auto">Contains, afterwards, a sequence, possibly <strong>empty</strong> of <strong>word</strong> characters or an <strong>apostrophe</strong> ( <strong><code>'</code></strong> ) , a <strong>dot</strong> ( <strong><code>.</code></strong> ), an <strong>hyphen</strong> ( <strong><code>-</code></strong> ) or a <strong>space</strong> symbol</p>
</li>
<li>
<p dir="auto">And ends with with a <strong>word</strong> character, possibly <strong>followed</strong> by an <strong>apostrophe</strong> ( <strong><code>'</code></strong> ), a <strong>dot</strong> ( <strong><code>.</code></strong> ) or a <strong>comma</strong> ( <strong><code>,</code></strong> ) symbols</p>
</li>
</ul>
<hr />
<p dir="auto">Only the <strong>inner</strong> part, beginning and ending with a <strong>word</strong> character, is considered as the <strong>group 2</strong>, which <strong>must</strong> occur, further on, a <strong>second</strong> time. Note also, that names, with some <strong>leading</strong> or <strong>trailing</strong> symbols, may be surrounded, again, by <strong>double quotes</strong>, thanks to the syntax : <strong><code>("?)['.,]?(\w[\w '.-]*\w)['.,]?\1</code></strong></p>
<p dir="auto">On the other hand, it’s important to point pout that the <strong>duplicate</strong> name matched, with the regex <strong><code>("?)['.,]?\2['.,]?\3</code></strong> :</p>
<ul>
<li>
<p dir="auto">Can have <strong>leading</strong> or <strong>trailing</strong> symbols, different from the <strong>first</strong> occurrence, to be <strong>deleted</strong></p>
</li>
<li>
<p dir="auto">Can be <strong>surrounded</strong>, or <strong>not</strong>, with <strong>double quotes</strong>, independently, too, from the <strong>first</strong> occurrence, to be <strong>deleted</strong></p>
</li>
</ul>
<hr />
<p dir="auto">To end with, the names, with a <strong>single</strong> double-quote ( as <strong><code>"xxxx</code></strong> or <strong><code>yyyy"</code></strong> ) are considered as <strong>invalid</strong> entities. Indeed, let’s suppose the <strong>initial</strong> text, below :</p>
<pre><code class="language-diff">{ 000 "123 555 456" 999 "123 456" 789 }
</code></pre>
<p dir="auto">If names <strong>must</strong> be surrounded with <strong>double-quotes</strong>, or <strong>not</strong>, we get the <strong>same</strong> text, as there is <strong>no duplicate</strong> :</p>
<pre><code class="language-diff">{ 000 "123 555 456" 999 "123 456" 789 }
</code></pre>
<p dir="auto">If names as <strong><code>"123</code></strong> or <strong><code>456"</code></strong> were allowed, we would get the <strong>wrong</strong> text, below :</p>
<pre><code class="language-diff">{ 000 555 999 "123 456" 789 }
</code></pre>
<hr />
<p dir="auto">So <strong>Marc</strong>, the <strong>new</strong> regex, below, should, <strong>correctly</strong>, miss <strong>very few</strong> names ;-)) And, thus, get rid of the great <strong>majority</strong> of the <strong>duplicates</strong> !</p>
<p dir="auto">SEARCH <strong><code>(?si)(?:^|\h+)("?)['.,]?(\w[\w '.-]*\w)['.,]?\1(?=(?:\h+|\R)(?:[^{}]*(?:\h+|\R))?("?)['.,]?\2['.,]?\3(?:\h|\R))</code></strong></p>
<hr />
<p dir="auto">And, with the <strong>free-spacing</strong> mode, which allows to identify the different <strong>parts</strong> of this regex, it gives :</p>
<p dir="auto">SEARCH <strong><code>(?xsi) (?: ^|\h+)  ("?)  ['.,]?  ( \w[\w '.-]*\w )  ['.,]?  \1  (?= (?: \h+|\r?\n)  (?: [^{}]*  (?: \h+|\r?\n) )?  ("?) ['.,]?  \2 ['.,]?  \3  (?: \h|\r?\n) )</code></strong></p>
<hr />
<p dir="auto">Oh, I forgot to say that the search, is, from now on, <strong>insensitive</strong> to the <strong>case</strong>, due to the <strong>modifiers</strong> syntax <strong><code>(?is)</code></strong>,  at <strong>beginning</strong> of the regex. So, assuming the text :</p>
<pre><code class="language-diff">{ ZhanYong Zhanyong }
</code></pre>
<p dir="auto">The <strong>first</strong> word would, indeed, be a <strong>duplicate</strong> of the <strong>second</strong> one ans, thus <strong>deleted</strong>  !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30248</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30248</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 12 Feb 2018 21:38:17 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Mon, 12 Feb 2018 16:54:21 GMT]]></title><description><![CDATA[<p dir="auto">Luckily late last night i realized i somehow blanked a file relating to this so i had a fresh copy to hit with the most recent revision. It tagged 1600 dupes. Running my validator over it, catches four different occurrences it failed. totaling just 20 errors.</p>
<p dir="auto">Instances it failed.<br />
__<br />
“Ko cheng”</p>
<p dir="auto">location, start of line after tabs, its twin was second from end of same line<br />
__<br />
This one i imagine will be a bit tricky :/ (if even possible)</p>
<p dir="auto">ZhanYong,</p>
<p dir="auto">Location anywhere, its twin has the Y lowercase instead.<br />
__<br />
'Abd</p>
<p dir="auto">Location anywhere, culprit probably punctuation at start<br />
__<br />
cont.</p>
<p dir="auto">Location anywhere, Probably reverse reason as above<br />
__<br />
Cheers. and Ive spread the one from last night to a few people, they pass their thanks to you for this. it saves so much time</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30240</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30240</guid><dc:creator><![CDATA[Marc Lalonde]]></dc:creator><pubDate>Mon, 12 Feb 2018 16:54:21 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Mon, 12 Feb 2018 11:06:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marc-lalonde" aria-label="Profile: marc-Lalonde">@<bdi>marc-Lalonde</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Ah, I see ! So, I just changed the <strong><code>\x20+</code></strong> syntax with the <strong><code>\h+</code></strong> one, to include <strong>tabulations</strong> and <strong>No-Break space</strong> characters as possible <strong>separators</strong></p>
<p dir="auto">Secondly, in order to consider the <strong>apostrophe</strong> <strong><code>'</code></strong> and the <strong>hyphen</strong> <strong><code>-</code></strong> as possible <strong>word character</strong>, I changed the syntax <strong><code>(\w[\w ]*\w)</code></strong> with the <strong><code>(\w[\w '-]*\w)</code></strong> one !</p>
<p dir="auto">So, the <strong>final</strong> version of the regex is, from now on :</p>
<p dir="auto">SEARCH <strong><code>(?s-i)(?:^|\h+)("?)(\w[\w '-]*\w)\1(?=(?:\h+|\R)(?:[^{}]*(?:\h+|\R))?("?)\2\3(?:\h|\R))</code></strong></p>
<p dir="auto">and, with the <strong>free-spacing</strong> mode, which allows to identify the different <strong>parts</strong> of this regex, it gives :</p>
<p dir="auto">SEARCH <strong><code>(?xs-i) (?: ^|\h+) ("?) (\w[\w '-]*\w)  \1  (?= (?: \h+|\r?\n)  (?: [^{}]* (?: \h+|\r?\n) )?  ("?) \2 \3  (?: \h|\r?\n) )</code></strong></p>
<hr />
<p dir="auto">Just tell me if <strong>other</strong> characters, than the <strong>apostrophe</strong>, the <strong>hyphen</strong> and the <strong>space</strong> characters, may exist in your list of <strong>names</strong> :-))</p>
<p dir="auto">Cheers</p>
<p dir="auto">guy038</p>
<p dir="auto"><strong>P.S.</strong> :</p>
<p dir="auto">Note that, with the <strong>free-spacing</strong> regex <strong><code>(?x)</code></strong>, the <strong><code>\R</code></strong> syntax is <strong>forbidden</strong> ! So, I changed it by the usual <strong><code>\r?\n</code></strong> syntax !</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30232</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30232</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 12 Feb 2018 11:06:06 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Mon, 12 Feb 2018 02:41:13 GMT]]></title><description><![CDATA[<p dir="auto">At the very least, as i just ran the extended script above on all my files, 1100 errors down to all of 115 in one click. I owe you a drink :D</p>
<p dir="auto">Only things its missing right now, are the start of lines, 2-3 tabs in (reference screenshot above) and ones with punctuation mid word. EG: Abu’l-Ghazi</p>
<p dir="auto">But if its just 115 errors, i can handle that without much more work :D</p>
<p dir="auto">Again i cant thank you enough, and ill be sharing this script with a fellow person having to deal with a very similar issue.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30227</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30227</guid><dc:creator><![CDATA[Marc Lalonde]]></dc:creator><pubDate>Mon, 12 Feb 2018 02:41:13 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Mon, 12 Feb 2018 02:14:07 GMT]]></title><description><![CDATA[<p dir="auto">That got almost All of my goal, one more small effort should finish this. Here is a screenshot of the full file structure, the only things i see it missing right now, is at the very start of the line, (Reference to the right screen/side) which is 3-4 tabs in. didnt think that would be an issue but its seeming to be. Other than that, it got all 19 alone in this section.</p>
<p dir="auto"><a href="https://imgur.com/a/MO0dV" rel="nofollow ugc">https://imgur.com/a/MO0dV</a></p>
<p dir="auto">One hell of a job so far, this will get me able to finish this tonight likely (even with just this script part) myself and i very much appreciate the help.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30226</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30226</guid><dc:creator><![CDATA[Marc Lalonde]]></dc:creator><pubDate>Mon, 12 Feb 2018 02:14:07 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Mon, 12 Feb 2018 02:05:19 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/marc-lalonde" aria-label="Profile: marc-Lalonde">@<bdi>marc-Lalonde</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">I think that my <strong>new</strong> version should be very <strong>close</strong> to to your needs ! Just try it out :-)</p>
<p dir="auto">So, assuming the following <strong>hypotheses</strong> :</p>
<ul>
<li>
<p dir="auto">Names with <strong>one</strong> word of <strong>two word</strong> character, <strong>minimum</strong> or with <strong>several</strong> words, separated with, at least, <strong>one space</strong> character, possibly surrounded by <strong>double-quotes</strong></p>
</li>
<li>
<p dir="auto">Names are <strong>preceded</strong> with, at least, <strong>one space</strong> char or are located at the <strong>beginning</strong> of a line</p>
</li>
<li>
<p dir="auto">Names are <strong>followed</strong> with , at least, <strong>one space</strong> char or are located at the <strong>end</strong> of a line</p>
</li>
<li>
<p dir="auto">Each <strong>block</strong> of names is <strong>embedded</strong> in a <strong><code>{.........}</code></strong> block, in a <strong>single</strong> line or split on <strong>several</strong> lines</p>
</li>
<li>
<p dir="auto">If a name is <strong>preceded</strong> of <strong>followed</strong> with a brace, <strong>one space</strong> character, at least, must <strong>separate</strong> them</p>
</li>
</ul>
<p dir="auto">Then, the <strong>correct</strong> version for removing <strong>duplicates</strong> names of <strong>each</strong> block, only, should be :</p>
<p dir="auto">SEARCH <strong><code>(?s-i)(?:^|\x20+)("?)(\w[\w ]*\w)\1(?=(?:\x20+|\R)(?:[^{}]*(?:\x20+|\R))?("?)\2\3(?:\x20|\R))</code></strong></p>
<hr />
<p dir="auto"><strong>Remark</strong> :</p>
<p dir="auto">Compared to my <strong>previous</strong> version, this regex is more <strong>complex</strong>. Son for a best <strong>understanding</strong>, here is the <strong>equivalent</strong> version, with the <strong>free-spacing</strong> regex mode, which allows to insert <strong>non-significant space</strong> characters, in the regex !</p>
<p dir="auto">SEARCH <strong><code>(?xs-i) (?: ^|\x20+) ("?) (\w[\w ]*\w)  \1  (?= (?: \x20+|\r?\n)  (?: [^{}]* (?: \x20+|\r?\n) )?  ("?) \2 \3  (?: \x20|\r?\n) )</code></strong></p>
<hr />
<p dir="auto">So given, for instance, the <strong>initial</strong> text below :</p>
<pre><code class="language-diff">{
123 123 654
 321 456
 999 852 666 "852"
 123
}

{
 123 654 222 333 999
 852 "999" 456 123
 000 "123 654" "999"
}

{
 "123 654" 555 "111"
 852 111 "123" "000"
 999 "333" "123 654" 000 333
}

{
111 789
789
789 222
333 789 444
}
{
555 "789"
"789"
"789" 666
777 "789" 888
}

{            3456      "3456"      3456       }

{ "6789" 6789 "6789" }

{
 "456" "12 34 56" 456 "123" "456" 123 "12 34 56" 789
}

</code></pre>
<p dir="auto">We get the following text :</p>
<pre><code class="language-diff">{
 654
 321 456
 999 666 "852"
 123
}

{
 222 333
 852 456 123
 000 "123 654" "999"
}

{
 555
 852 111 "123"
 999 "123 654" 000 333
}

{
111

 222
333 789 444
}
{
555

 666
777 "789" 888
}

{      3456       }

{ "6789" }

{
 "456" 123 "12 34 56" 789
}
</code></pre>
<p dir="auto">Waooooooo  ! This regex <strong>totally</strong> drained me ;-))</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30225</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30225</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 12 Feb 2018 02:05:19 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Mon, 12 Feb 2018 01:22:22 GMT]]></title><description><![CDATA[<p dir="auto">would it be better if you could see exactly what im trying to work with to make the script? I would be willing to link Via team-viewer (<a href="https://www.teamviewer.com/en/" rel="nofollow ugc">https://www.teamviewer.com/en/</a>) so you have a better idea of exactly is needed, still got some 1100 duplicates still to hunt down. fyi im still stuck behind the 2 rep wall of only 20 mins between posts &gt;.&lt;</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30224</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30224</guid><dc:creator><![CDATA[Marc Lalonde]]></dc:creator><pubDate>Mon, 12 Feb 2018 01:22:22 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Mon, 12 Feb 2018 01:01:33 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <strong>Marc</strong>,</p>
<p dir="auto">I don’t give up :-)) Just making <strong>numerous</strong> tests. It should be <strong>OK</strong>, very soon…</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30223</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30223</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Mon, 12 Feb 2018 01:01:33 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Mon, 12 Feb 2018 00:02:48 GMT]]></title><description><![CDATA[<p dir="auto">I do have to say thank you though, if its not possible to get it to just look inside each set of { } as a unique group in one mass sweep. then at the very least its made the job that much more manageable. some 300 entries were caught by the scripts above, which is 300 i don’t have to look for. so thanks again there guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30222</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30222</guid><dc:creator><![CDATA[Marc Lalonde]]></dc:creator><pubDate>Mon, 12 Feb 2018 00:02:48 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Sun, 11 Feb 2018 22:01:14 GMT]]></title><description><![CDATA[<p dir="auto">Thats very nearly got it, just need to detect the closing bracket</p>
<p dir="auto">EG<br />
{<br />
Line 1: 123 654<br />
line 2: 321 456<br />
}<br />
{<br />
Line 1: 123 654<br />
Line 2: 582 456 123<br />
}</p>
<p dir="auto">Would only hit on the 123 pair in the second set</p>
<p dir="auto">Ie<br />
{<br />
Line 1: 123 654<br />
line 2: 321 456<br />
}<br />
{<br />
Line 1: 654<br />
Line 2: 582 456 123<br />
}</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30219</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30219</guid><dc:creator><![CDATA[Marc Lalonde]]></dc:creator><pubDate>Sun, 11 Feb 2018 22:01:14 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Sun, 11 Feb 2018 21:55:24 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/marc-lalonde" aria-label="Profile: marc-Lalonde">@<bdi>marc-Lalonde</bdi></a></p>
<p dir="auto">Use this regex, below :</p>
<p dir="auto">SEARCH <strong><code>(?s-i)\x20("?)(\w[\w ]*\w)\1(?=\x20(?:.+?\x20)?("?)\2\3\x20)</code></strong></p>
<p dir="auto">Compared to my <strong>previous</strong> one, I’ve just changed the part <strong><code>(?-is)</code></strong> by the syntax <strong><code>(?s-i)</code></strong></p>
<hr />
<p dir="auto">So assuming your <strong>last</strong> example ( which needed some re-formatting, to be sure that <strong>names</strong>, with <strong>double quotes</strong> or <strong>not</strong>, are surrounded with <strong>space</strong> chars ! ), and with, BTW, <strong><code>3</code></strong> duplicates :  <strong><code>123</code></strong>, <strong><code>321</code></strong> and <strong><code>852</code></strong> !</p>
<pre><code class="language-diff">{ 123 321 654 }
{ 123 951 753 "123" }
{ 456 852 "753 123" }
{ 123 "321" 852 }
</code></pre>
<p dir="auto"><strong>AFTER</strong> replacement, we get the <strong>new</strong> text below :</p>
<pre><code class="language-diff">{ 654 }
{ 951 753 }
{ 456 "753 123" }
{ 123 "321" 852 }
</code></pre>
<p dir="auto">I hope, this <strong>last</strong> version is the good one ;-))</p>
<p dir="auto">Best Regards</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30217</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30217</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 11 Feb 2018 21:55:24 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Sun, 11 Feb 2018 21:30:56 GMT]]></title><description><![CDATA[<p dir="auto">While it did get 201 instances remaining, it doesn’t get them if they are on different Lines, … anyway of adjusting it to do so?</p>
<p dir="auto">Example</p>
<p dir="auto">Line 1 :123 321 654<br />
Line 2 :123 951 753 “123”<br />
Line 3: 456 852 “753 123”<br />
Line 4: 123 “321” 852</p>
<p dir="auto">123, 321 are both dupes in this example</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30216</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30216</guid><dc:creator><![CDATA[Marc Lalonde]]></dc:creator><pubDate>Sun, 11 Feb 2018 21:30:56 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Sun, 11 Feb 2018 21:27:10 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/marc-lalonde" aria-label="Profile: marc-lalonde">@<bdi>marc-lalonde</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">I’m answering to myself ! For <strong>equivalent</strong> matches, I could simplify the regex to that <strong>shorter</strong> version :</p>
<p dir="auto">SEARCH <strong><code>(?-is)\x20("?)(\w[\w ]*\w)\1(?=\x20(?:.+?\x20)?("?)\2\3\x20)</code></strong></p>
<p dir="auto">BTW, this <strong>new</strong> regex handle names with a <strong>minimum</strong> of <strong>two word</strong> characters ( Only <strong>one-letter</strong> names  are <strong>not</strong> supported !! )</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30215</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30215</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 11 Feb 2018 21:27:10 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Sun, 11 Feb 2018 20:04:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marc-lalonde" aria-label="Profile: marc-lalonde">@<bdi>marc-lalonde</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Perfect  I’ve got the <strong>right</strong> regex to get what you want  ! Just follow the <strong>few</strong> steps, below :</p>
<ul>
<li>
<p dir="auto">First, of course, do a <strong>backup</strong> of your file !</p>
</li>
<li>
<p dir="auto">Open your file in N++</p>
</li>
<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>(?-is)\x20(?|"(\w[\w ]+\w)"|(\w[\w ]+\w))(?=\x20(.+?\x20)?("?)\1\3\x20)</code></strong> , in the <strong>Find what:</strong> zone</p>
</li>
<li>
<p dir="auto">Leave the <strong>Replace with:</strong> zone <strong><code>EMPTY</code></strong></p>
</li>
<li>
<p dir="auto">Tick the <strong>Wrap around</strong> and the <strong>Regular expression</strong> options, ONLY</p>
</li>
<li>
<p dir="auto">Click on the <strong><code>Replace All</code></strong> button or, <strong>repeatedly</strong>, on the <strong><code>Replace</code></strong> button</p>
</li>
</ul>
<p dir="auto">Et voilà !</p>
<hr />
<p dir="auto"><strong>Remarks</strong> :</p>
<ul>
<li>
<p dir="auto">I forgot to ask you about the <strong>case</strong> of the names : I mean, for instance, are the names <strong>Devi</strong>, <strong>DEVI</strong>, <strong>devi</strong>, <strong>DeVi</strong>,… all <strong>identical</strong> ? If so, just change the <strong>modifiers</strong> part <strong><code>(?-is)</code></strong>, at beginning of the regex, into <strong><code>(?i-s)</code></strong></p>
</li>
<li>
<p dir="auto">I assume that each <strong>block</strong> begins with an <strong>opening</strong> brace, followed with a <strong>space</strong> character and ends with a <strong>space</strong> character followed with a <strong>closing</strong> brace</p>
</li>
<li>
<p dir="auto">This regex <strong>correctly</strong> delete the <strong>first</strong> occurrence of <strong>two consecutive identical</strong> names, as below :</p>
</li>
</ul>
<p dir="auto"><strong><code>male_names = { "xxxxxx" "Barom Reachea" Barom Reachea "zzzzzz" }</code></strong></p>
<ul>
<li>Note that it’s <strong>not</strong> very easy to visualize the entire <strong>gap</strong> between two <strong>duplicates</strong>, because of the <strong>overlapping</strong> phenomena, which may occur, like in :</li>
</ul>
<p dir="auto"><strong><code>male_names = { "xxxxxx" "Barom Reachea" "Soriyotei" Barom Reachea "yyyyyy" "Barom Reachea" "zzzzzz" Soriyotei }</code></strong></p>
<p dir="auto">So just use the <strong>Find</strong> dialog, with the regex above, which will match and select the <strong>first</strong> occurrence of <strong>duplicate</strong> names, before performing the <strong>Replace</strong> operation</p>
<hr />
<p dir="auto">Next time, <strong>Marc</strong>,  I’ll give you some information on the <strong>regex</strong> itself, if you want to !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
<p dir="auto"><strong>P.S.</strong> :</p>
<p dir="auto">May be, this <strong>complicated</strong> regex  can be shortened  ! Anyway, this one is working <strong>fine</strong> :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30211</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30211</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 11 Feb 2018 20:04:03 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Sun, 11 Feb 2018 18:23:54 GMT]]></title><description><![CDATA[<p dir="auto">ok let me try again, say we have this string</p>
<p dir="auto">BEFORE : male_names = { “Ang Chan” “Barom Reachea” “Soriyotei” “Barom Reachea” “Sri Raja” Soriyotei }</p>
<p dir="auto">AFTER : male_names = { “Ang Chan” “Barom Reachea” “Sri Raja” Soriyotei }</p>
<p dir="auto">Marking for readability</p>
<p dir="auto">{ |“Ang Chan”| |“Barom Reachea”| |“Soriyotei”| |“Barom Reachea”| |“Sri Raja”| |Soriyotei| }<br />
{ |“Ang Chan”| |“Barom Reachea”| |“Sri Raja”| |Soriyotei| }</p>
<p dir="auto">basically its read inside the | | marks if the inside of them is the same, then its a duplicate.There is only 1 space between each item. and in any case of duplication only one is kept<br />
<code>Eg 123 "123" 123 654 123 123 987 12</code><br />
only one 123 would be kept</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30207</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30207</guid><dc:creator><![CDATA[Marc Lalonde]]></dc:creator><pubDate>Sun, 11 Feb 2018 18:23:54 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Sun, 11 Feb 2018 18:10:51 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/marc-lalonde" aria-label="Profile: marc-lalonde">@<bdi>marc-lalonde</bdi></a> and <strong>All</strong>,</p>
<blockquote>
<p dir="auto">would need both the “Barom Reachea” extra and one of the two Soriyotei (preference leaning to quoted one) removed</p>
</blockquote>
<p dir="auto">I’m really sorry but I did <strong>not</strong> fully understand this sentence ! Do you mean that you want to <strong>delete</strong> the <strong>two</strong> occurrences of the <strong><code>"Barom Reachea"</code></strong> name, in your example ?</p>
<p dir="auto">So, do you mind using that simple syntax, below, which clearly shows what you expect to ?</p>
<p dir="auto">BEFORE  : <strong><code>male_names = { "Ang Chan" "Barom Reachea" "Soriyotei" "Barom Reachea" "Sri Raja" Soriyotei }</code></strong></p>
<p dir="auto">AFTER : <strong><code>???</code></strong></p>
<hr />
<p dir="auto">On the other hand, what to do if there are <strong>more than 2</strong> duplicates ? So, again, with the same syntax :</p>
<p dir="auto">BEFORE : <strong><code>male_names = { "xxxxxx" "Barom Reachea" "Soriyotei" Barom Reachea "yyyyyy" "Barom Reachea" "zzzzzz" Soriyotei }</code></strong></p>
<p dir="auto">AFTER : <strong><code>???</code></strong></p>
<hr />
<p dir="auto">Finally, are the names, within <strong>double quotes</strong> or no, <strong>always</strong> separated with a <strong>single space</strong> character only ? Or is this kind of list possible ( with <strong>multiple</strong> spaces / tabulations, even <strong><code>0</code></strong> ), like below  ?</p>
<pre><code class="language-diff">male_names = { "xxxxxx"          "Barom Reachea" "Soriyotei" Barom Reachea	"yyyyyy" "Barom Reachea""zzzzzz" Soriyotei }
</code></pre>
<hr />
<p dir="auto">Just note, that according to the general behaviour of the N++ <strong>regex engine</strong>, the <strong>easiest</strong> way would be to <strong>delete all</strong> duplicates but the <strong>last</strong> one , <strong>whatever</strong> the name is surrounded, or <strong>not</strong>, with <strong>double quotes</strong> !</p>
<p dir="auto">So, given the previous example :</p>
<pre><code class="language-diff">male_names = { "xxxxxx" "Barom Reachea" "Soriyotei" Barom Reachea "yyyyyy" "Barom Reachea" "zzzzzz" Soriyotei }
</code></pre>
<p dir="auto">we would obtain, <strong>AFTER</strong> replacement :</p>
<pre><code class="language-diff">male_names = { "xxxxxx" "yyyyyy" "Barom Reachea" "zzzzzz" Soriyotei }
</code></pre>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30206</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30206</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 11 Feb 2018 18:10:51 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Sun, 11 Feb 2018 17:07:32 GMT]]></title><description><![CDATA[<p dir="auto">Just saw this, ty for responding, in this case, B would work nicer, and case 1 more less, sometimes single words are in quotes, most times they are not, but they too can potentially have a quoted one and a unquoted one (which are counted as duplicates)</p>
<p dir="auto">so</p>
<p dir="auto"><code> male_names = { "Ang Chan" "Barom Reachea" "Soriyotei" "Barom Reachea" "Sri Raja" Soriyotei }</code></p>
<p dir="auto">would need both the “Barom Reachea” extra and one of the two Soriyotei (preference leaning to quoted one) removed</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30201</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30201</guid><dc:creator><![CDATA[Marc Lalonde]]></dc:creator><pubDate>Sun, 11 Feb 2018 17:07:32 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Sun, 11 Feb 2018 13:42:58 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/marc-lalonde" aria-label="Profile: marc-lalonde">@<bdi>marc-lalonde</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">OK, <strong>Marc</strong>, I"ve already find out the <strong>right</strong> regex  to match the <strong>gap</strong> between <strong>two duplicates</strong> names, of a <strong>same</strong> block !</p>
<p dir="auto">Now, I need <strong>additional</strong> information :-)</p>
<p dir="auto">Given, for instance, the text, below, with the <strong><code>Barom Reachea</code></strong> <strong>duplicate</strong> name :</p>
<pre><code class="language-diff">male_names = { "Ang Chan" "Barom Reachea" "Soriyotei" "Barom Reachea" "Sri Raja" }
</code></pre>
<p dir="auto">Do you expect, <strong>AFTER</strong> replacement, the text <strong><code>A</code></strong> :</p>
<pre><code class="language-diff">male_names = { "Ang Chan" "Barom Reachea" "Soriyotei" "Sri Raja" }
</code></pre>
<p dir="auto">OR the text <strong><code>B</code></strong> :</p>
<pre><code class="language-diff">male_names = { "Ang Chan" "Soriyotei" "Barom Reachea" "Sri Raja" }
</code></pre>
<p dir="auto">In addition, could you tell me <strong>which</strong> text cases may happen ? ( From your <strong>previous</strong> post, I understood that cases <strong><code>1</code></strong> and <strong><code>2</code></strong> <strong>do</strong> occur ! )</p>
<p dir="auto">Case <strong>1</strong> : <strong><code>male_names = { "Ang Chan" "Barom Reachea" "Soriyotei" "Barom Reachea" "Sri Raja" }</code></strong></p>
<p dir="auto">Case <strong>2</strong> : <strong><code>male_names = { Ang Chan Barom Reachea Soriyotei Barom Reachea Sri Raja }</code></strong></p>
<p dir="auto">Case <strong>3</strong> : <strong><code>male_names = { "Ang Chan" "Barom Reachea" Soriyotei Barom Reachea "Sri Raja" }</code></strong></p>
<p dir="auto">Case <strong>4</strong> : <strong><code>male_names = { "Ang Chan" Barom Reachea Soriyotei "Barom Reachea" "Sri Raja" }</code></strong></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/30195</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30195</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 11 Feb 2018 13:42:58 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing Duped Words across a block block of text, respecting {} on Sun, 11 Feb 2018 11:07:27 GMT]]></title><description><![CDATA[<p dir="auto">A Good example i found a bit further along the file in reference to the sometimes in quotes " "<br />
<code>male_names = { 			|"Barom Reachea"| "Noreay Ramathipatei" "Soriyotei" "Thommo Reachea" "Srey Sukonthor" "Ang Chan" "Reachea Ramathipatei" 			|"Barom Reachea"| "Chey Chettha" "Ney Khan" "Preah Ram" "Keo Hua" "Outey Reachea" "Dharmaraja" "Padumaraja" "Ramathipadi" "Satha" "Ream Reachea" |"Narayanaraja"| "Ponhea Yat" |"Narayanaraja"|  			"Sri Raja" "Rajadhiraja" "Dharmarajadhiraja" "Damkhat Sukonthor" "Reamea Chungprey" "Keo Ban On" "Ponhea Yor" "Ponhea An" "Ponhea Nhom" "Srei Soriyopear" "Udayaraja" "Ponhea To" "Ang Non" "Ponhea Chan" "Ang Sur"  			"Ang Chea" "Ang Nan" "Ang Sor" "Ang Yong" "Ang Em" "Ang Tham" "Ang Sngoun" "Ang Tong" "Ang Ton" "Ang Eng"  			"Ang Duong" 		}</code><br />
All of the stuff in " "  are all unique strings. In this case its spread across 6 lines, there is 2 Dupes strung about this block. (Marked with | on either side | for reading)</p>
<p dir="auto">Also I wouldn’t mind if i had to say select each block 1 by one, i do have a external program that’s at least pointing out where each dupe is, but having to look by hand for each case is proving troublesome to keep focused</p>
]]></description><link>https://community.notepad-plus-plus.org/post/30189</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/30189</guid><dc:creator><![CDATA[Marc Lalonde]]></dc:creator><pubDate>Sun, 11 Feb 2018 11:07:27 GMT</pubDate></item></channel></rss>