<?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 word between commas not included in a list of words]]></title><description><![CDATA[<p dir="auto">Hello everyone,</p>
<p dir="auto">below the text I’d wish to get help with.</p>
<pre><code>https://url.com,"text - text",27305664219,10300104,https://images.url.com/products/jacket-original-piumino-smanicato-grigio-colorblock/20870943-1-asphalt?$XXL$,"Gilet di Brand Bello indossare una giacca nuova! Modello a blocchi di colore Collo a imbuto Chiusura con zip Etichetta con logo Tasche laterali Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Giacche e Cappotti &gt; Gilet",38.99,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fjack-jones-originals-piumino-smanicato-grigio-colorblock%2F20870943-1-asphalt%3F%24XXL%24&amp;feedId=36675&amp;k=40c130faec57ad6220fdad81baad41e935cc3845,EUR,,0.00,https://www.asos.com/it/jack-jones/jack-jones-originals-piumino-smanicato-grigio-colorblock/prd/20870943?browseCountry=IT&amp;browseCurrency=EUR,,,EUR38.99,36675,"jack &amp; jones",Grigio,,23527,,,,,"38.99 €","0.00 €",,,

</code></pre>
<p dir="auto">I’m wondering whether it is possible to replace any word, between the 22nd and the 23rd comma, different from these list of words</p>
<ul>
<li>bianco</li>
<li>nero</li>
<li>rosso</li>
<li>giallo</li>
<li>blu</li>
<li>verde</li>
<li>arancione</li>
<li>grigio</li>
<li>viola</li>
<li>marrone</li>
<li>mimetico</li>
<li>beige</li>
<li>bordeaux</li>
</ul>
<p dir="auto">into the word “altri”.</p>
<p dir="auto">Any help is much appreciated.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/20402/replacing-word-between-commas-not-included-in-a-list-of-words</link><generator>RSS for Node</generator><lastBuildDate>Sun, 14 Jun 2026 03:49:48 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/20402.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 29 Nov 2020 21:45:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Replacing word between commas not included in a list of words on Sat, 26 Dec 2020 12:10:57 GMT]]></title><description><![CDATA[<p dir="auto">First of all I have to say that I’m amazed about this group and the level of competence you guys have.<br />
I just got the time to work on this project and here what I have found.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/astrosofista" aria-label="Profile: astrosofista">@<bdi>astrosofista</bdi></a> said in <a href="/post/60307">Replacing word between commas not included in a list of words</a>:</p>
<blockquote>
<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/fred-zept" aria-label="Profile: fred-zept">@<bdi>fred-zept</bdi></a></p>
<p dir="auto">Please, try the following regex, based in the expressions provided yesterday:</p>
<pre><code class="language-z">Search: ^((([^,]*),){22}(?!bianco|nero|rosso|giallo|blu|verde|arancione|grigio|viola|marrone|mimetico|beige|bordeaux))([^,]+)
Replace: ${1}altri
</code></pre>
<p dir="auto">Have fun!</p>
</blockquote>
<p dir="auto">Thanks, this seems to work on most of the lines. In some other line seems to change the value on the 21st comma rather than 22nd.<br />
It works on the first line, although on the second line change the word Topman, which is the brand and not the colour, rather than Pietra</p>
<pre><code>https://www.awin1.com/pclick.php?p=27397554539&amp;a=357849&amp;m=9606,"adidas Originals - Smanicato con 3 strisce nero",27397554539,9963546,https://images.asos-media.com/products/adidas-originals-smanicato-con-3-strisce-nero/20192202-1-black?$XXL$,"Gilet di Adidas Originals Il prossimo dei tuoi prodotti salvati Modello imbottito Collo a imbuto Logo Adidas Chiusura con zip Tasche laterali 3 strisce laterali Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Giacche e cappotti &gt; Gilet",74.95,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fadidas-originals-smanicato-con-3-strisce-nero%2F20192202-1-black%3F%24XXL%24&amp;feedId=36675&amp;k=1f40920a1b687eb73ed4ce4da992ec98bfaf0279,EUR,,0.00,https://www.asos.com/it/adidas-originals/adidas-originals-smanicato-con-3-strisce-nero/prd/20192202?browseCountry=IT&amp;browseCurrency=EUR,,,EUR74.95,36675,"adidas Originals",Porpora,,25479,,,,,"74.95 €","0.00 €",,,

https://www.awin1.com/pclick.php?p=27250398127&amp;a=357849&amp;m=9606,"Topman - Piumino smanicato riciclato color pietra",27250398127,10155883,https://images.asos-media.com/products/topman-piumino-smanicato-riciclato-color-pietra/20571492-1-stone?$XXL$,"Giacca di Topman Non oggi, per quando fa freddo Collo a imbuto Senza maniche Chiusura con zip Tasca con zip sul petto Tasche laterali Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Giacche e Cappotti &gt; Gilet",55.99,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Ftopman-piumino-smanicato-riciclato-color-pietra%2F20571492-1-stone%3F%24XXL%24&amp;feedId=36675&amp;k=2bd6e17c0634ad74c710a431ab947d5e483b4d4c,EUR,,0.00,https://www.asos.com/it/topman/topman-piumino-smanicato-riciclato-color-pietra/prd/20571492?browseCountry=IT&amp;browseCurrency=EUR,,,EUR55.99,36675,Topman,Pietra,,25487,,,,,"55.99 €","0.00 €",,,

</code></pre>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> your solution seems to work perfectly.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry-r" aria-label="Profile: Terry-R">@<bdi>Terry-R</bdi></a> I guess I’m in the middle of the good ones since I live in in Europe. And you are a good one for sure Terry, I’m still using your way to delete near duplicate lines.<br />
Thanks again.</p>
<p dir="auto">Thanks everyone for your help!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/61102</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/61102</guid><dc:creator><![CDATA[fred zept]]></dc:creator><pubDate>Sat, 26 Dec 2020 12:10:57 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing word between commas not included in a list of words on Mon, 30 Nov 2020 21:46:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/fred-zept" aria-label="Profile: fred-zept">@<bdi>fred-zept</bdi></a> said in <a href="/post/60305">Replacing word between commas not included in a list of words</a>:</p>
<blockquote>
<p dir="auto">I tried your 3 steps suggestion but it does the opposite I need.</p>
</blockquote>
<p dir="auto">Yes, that was due to the interpretation I had of your issue. I know we had a previous problem from you where again your choice of words made it difficult to understand the problem in one reading. As <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said, thanks for supplying the examples within the black boxes, and as he also said, putting in a before and after view of the examples can help immensely. Sort of like “a picture speaks a thousand words” (common saying in the English speaking world). We do know that English is not your first language from your previous problem and now you speak of being on “the other side of the planet”. Possibly we are ALL on the other side of the planet (from others).</p>
<p dir="auto">I’m in New Zealand (Aotearoa, Land of the Long White Cloud, God’s zone or God’s own) so in my defence I think I truly am on the other side of the planet. Given most problems pop up before I even get out of bed I’m at a disadvantage in supplying solutions. Most of the good ones are already gone! ;-))</p>
<p dir="auto">Cheers<br />
Terry</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60349</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60349</guid><dc:creator><![CDATA[Terry R]]></dc:creator><pubDate>Mon, 30 Nov 2020 21:46:35 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing word between commas not included in a list of words on Mon, 30 Nov 2020 21:25:09 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 in <a href="/post/60347">Replacing word between commas not included in a list of words</a>:</p>
<blockquote>
<p dir="auto">I use the \K syntax</p>
</blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/fred-zept" aria-label="Profile: fred-zept">@<bdi>fred-zept</bdi></a> , please note that <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a>’s solution missed one vital piece of information. As he used the <code>\K</code> in his regex you MUST press the “Replace All” button as this is the ONLY method of replacing the words. If using the “Replace” button no changers will be made. it is a side effect of using the <code>\K</code>.</p>
<p dir="auto">Cheers<br />
Terry</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60348</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60348</guid><dc:creator><![CDATA[Terry R]]></dc:creator><pubDate>Mon, 30 Nov 2020 21:25:09 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing word between commas not included in a list of words on Wed, 02 Dec 2020 17:37:45 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/fred-zept" aria-label="Profile: fred-zept">@<bdi>fred-zept</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/terry-r" aria-label="Profile: terry-r">@<bdi>terry-r</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/astrosofista" aria-label="Profile: astrosofista">@<bdi>astrosofista</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/terry-r" aria-label="Profile: terry-r">@<bdi>terry-r</bdi></a>,</p>
<p dir="auto">I first thougt that we shouldn’t <strong>bother</strong> about the possibility of having a <strong>double quote</strong> <strong><code>"</code></strong>, <strong>within</strong> a field, between <strong>two commas</strong>. Indeed, with the regex <strong><code>"[^"\r\n]+"</code></strong>, I verified all zones between <strong>double quotes</strong> of the <strong>first</strong> <a class="plugin-mentions-user plugin-mentions-a" href="/user/fred-zept" aria-label="Profile: fred-zept">@<bdi>fred-zept</bdi></a>’s sample and everything was <strong>OK</strong></p>
<p dir="auto">However, in his <strong>second</strong> sample code of <strong>six</strong> lines, the <strong><code>5th</code></strong> line contains a field between <strong>double quotes</strong>, with some <strong>commas</strong> inside ! So , we <strong>must</strong> take this fact in account !</p>
<p dir="auto">I’ve already noticed that the OP’s request was the <strong>opposite</strong> as he wants to <strong>replace</strong>, between the <strong><code>22th</code></strong> and the <strong><code>23th</code></strong> commas, any color, <em>DIFFERENT</em>  from <strong>any</strong> color of the list, with the <strong><code>altri</code></strong> value !</p>
<hr />
<p dir="auto">My solution is <strong>similar</strong> to the <a class="plugin-mentions-user plugin-mentions-a" href="/user/astrosofista" aria-label="Profile: astrosofista">@<bdi>astrosofista</bdi></a>’s one :</p>
<ul>
<li>
<p dir="auto">I added, at the beginning the <strong><code>(?i)</code></strong> <strong>modifier</strong> to get a search <strong>independent</strong> of the <strong>case</strong> !</p>
</li>
<li>
<p dir="auto">But I have considered, as a <strong>priority</strong>, the case of a <strong>field</strong> between <strong>quotation marks</strong>. Else, it’s a <strong>classical</strong> field, located between <strong>commas</strong></p>
</li>
<li>
<p dir="auto">I use the <strong><code>\K</code></strong> syntax</p>
</li>
<li>
<p dir="auto">I preferred to insert <strong><code>\r\n</code></strong> in the <strong>negative</strong> class characters <strong><code>[^.....]</code></strong></p>
</li>
<li>
<p dir="auto">At the <strong>end</strong> of the regex, I use the <strong><code>*</code></strong> quantifier, instead of <strong><code>+</code></strong> because a field may be <strong>empty</strong></p>
</li>
</ul>
<p dir="auto">Giving this S/R :</p>
<p dir="auto">SEARCH <strong><code>(?i)^(?:(?:"[^"\r\n]+"|[^,\r\n]*){1}+,){22}\K(?!bianco|nero|rosso|giallo|blu|verde|arancione|grigio|viola|marrone|mimetico|beige|bordeaux)[^,\r\n]*</code></strong></p>
<p dir="auto">REPLACE <strong><code>altri</code></strong></p>
<p dir="auto"><strong>Remark</strong> : You may have noticed the <strong><code>{1}+</code></strong> <strong>atomic quantifier</strong>. This is <strong>needed</strong> ! Let’s imagine that :</p>
<ul>
<li>
<p dir="auto">A line contains, somewhere, a <strong>field</strong> between double quotes <strong><code>"......."</code></strong></p>
</li>
<li>
<p dir="auto">This line <strong>also</strong> contains a color, from the <strong>list</strong>, between the <strong><code>22th</code></strong> and the <strong><code>23th</code></strong> commas</p>
</li>
</ul>
<p dir="auto">As the regex engine is trying <em>hard</em> to find a color <strong>different</strong> from one of the <strong>list</strong>, because of the <strong>negative look-ahead</strong>, then it would <strong>backtrack</strong> and test the <strong>second</strong> alternative <strong><code>[^,\r\n]*</code></strong> ,from the part <strong><code>(?:"[^"\r\n]+"|[^,\r\n]*){1}+</code></strong> , for a <strong>classical</strong> field, leading, finally, to a <strong>wrong</strong> result for the <strong><code>23th</code></strong> field !</p>
<p dir="auto">Now, adding the <strong>atomic quantifier</strong> <strong><code>{1}+</code></strong>, this prevents the regex engine from <strong>backtracking</strong>,. So it keeps the <strong>first</strong> alternative <strong><code>"[^"\r\n]+"</code></strong> which leads to a color, between the <strong><code>22th</code></strong> and the <strong><code>23th</code></strong> commas, being <strong>within</strong> the list . Thus, the <strong>current</strong> line does <strong>not</strong> satisfy the <strong>overall</strong> regex  and the regex engine skips to the <strong>next</strong> line. Logical !</p>
<hr />
<p dir="auto">Here’s the output, produced from the <a class="plugin-mentions-user plugin-mentions-a" href="/user/terry-r" aria-label="Profile: terry-r">@<bdi>terry-r</bdi></a>’s example of <strong>three</strong> lines ( <strong>two</strong> modifications in the <strong>last two</strong> lines ) :</p>
<pre><code>https://url.com,,27305664219,10300104,https://images.url.com/products/jacket-original-piumino-smanicato-grigio-colorblock/20870943-1-asphalt?$XXL$,"Gilet di Brand Bello indossare una giacca nuova! Modello a blocchi di colore Collo a imbuto Chiusura con zip Etichetta con logo Tasche laterali Vestibilità classica Veste perfettamente la taglia indicata",,38.99,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fjack-jones-originals-piumino-smanicato-grigio-colorblock%2F20870943-1-asphalt%3F%24XXL%24&amp;feedId=36675&amp;k=40c130faec57ad6220fdad81baad41e935cc3845,EUR,,0.00,https://www.asos.com/it/jack-jones/jack-jones-originals-piumino-smanicato-grigio-colorblock/prd/20870943?browseCountry=IT&amp;browseCurrency=EUR,text here,,EUR38.99,36675,"jack &amp; jones",Grigio,,23527,,,,,"38.99 €","0.00 €",,,
https://url.com,"text - text",27305664219,,,"Gilet di Brand Bello indossare una giacca nuova! Modello a blocchi di, colore Collo, a imbuto Chiusura con zip Etichetta con logo Tasche laterali Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Giacche e Cappotti &gt; Gilet",,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fjack-jones-originals-piumino-smanicato-grigio-colorblock%2F20870943-1-asphalt%3F%24XXL%24&amp;feedId=36675&amp;k=40c130faec57ad6220fdad81baad41e935cc3845,EUR,,0.00,https://www.asos.com/it/jack-jones/jack-jones-originals-piumino-smanicato-grigio-colorblock/prd/20870943?browseCountry=IT&amp;browseCurrency=EUR,,,,,"jack &amp; jones",altri,,23527,,,,,"38.99 €","0.00 €",,,
https://url.com,"text - text",27305664219,10300104,https://images.url.com/products/jacket-original-piumino-smanicato-grigio-colorblock/20870943-1-asphalt?$XXL$,"Gilet di Brand Bello indossare una giacca nuova! Modello a blocchi di colore Collo a imbuto Chiusura con zip Etichetta con, logo Tasche laterali Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Giacche e Cappotti &gt; Gilet",38.99,"Asos.com IT,",9606,"Men's, Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fjack-jones-originals-piumino-smanicato-grigio-colorblock%2F20870943-1-asphalt%3F%24XXL%24&amp;feedId=36675&amp;k=40c130faec57ad6220fdad81baad41e935cc3845,EUR,,0.00,https://www.asos.com/it/jack-jones/jack-jones-originals-piumino-smanicato-grigio-colorblock/prd/20870943?browseCountry=IT&amp;browseCurrency=EUR,,,EUR38.99,36675,"jack, &amp; jones",altri,,23527,,,,,"38.99 €","0.00 €",,,
</code></pre>
<hr />
<hr />
<p dir="auto">Now, <a class="plugin-mentions-user plugin-mentions-a" href="/user/fred-zept" aria-label="Profile: fred-zept">@<bdi>fred-zept</bdi></a>, if I’m using your <strong>last</strong> sample of <strong>six</strong> lines, I do get the <strong>expected result</strong>, with only the string <strong><code>altri</code></strong> placed in the <strong>two first</strong> lines, between the <strong><code>22th</code></strong> and the <strong><code>23th</code></strong> commas !</p>
<pre><code>https://www.awin1.com/pclick.php?p=27545432277&amp;a=357849&amp;m=9606,"Jack &amp; Jones - Piumino smanicato verde",27545432277,10376888,https://images.asos-media.com/products/jack-jones-piumino-smanicato-verde/21025644-1-dustyolive?$XXL$,"Gilet di Jack &amp; Jones Le maniche sono sopravvalutate Collo alto Senza maniche Chiusura con zip Logo applicato sul torace Tasche con zip ai lati Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Saldi &gt; Giacche e Cappotti",30.99,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fjack-jones-piumino-smanicato-verde%2F21025644-1-dustyolive%3F%24XXL%24&amp;feedId=36675&amp;k=c025ee86b55779a9b1bf35cda2bf257a5f636709,EUR,,0.00,https://www.asos.com/it/jack-jones/jack-jones-piumino-smanicato-verde/prd/21025644?browseCountry=IT&amp;browseCurrency=EUR,,,EUR30.99,36675,"jack &amp; jones",altri,,23527,,,,,"30.99 €","56.99 €",,,
https://www.awin1.com/pclick.php?p=27577712641&amp;a=357849&amp;m=9606,"Hollister - Piumino smanicato nero con logo",27577712641,10445580,https://images.asos-media.com/products/hollister-piumino-smanicato-nero-con-logo/21162914-1-black?$XXL$,"Gilet di Hollister Le maniche sono sopravvalutate Modello imbottito Chiusura con zip Tasche laterali Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Giacche e cappotti &gt; Gilet",64.99,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fhollister-piumino-smanicato-nero-con-logo%2F21162914-1-black%3F%24XXL%24&amp;feedId=36675&amp;k=1947edd8eabd2ec2622a871a1440bb3de34d17f9,EUR,,0.00,https://www.asos.com/it/hollister/hollister-piumino-smanicato-nero-con-logo/prd/21162914?browseCountry=IT&amp;browseCurrency=EUR,,,EUR64.99,36675,Hollister,altri,,25563,,,,,"64.99 €","0.00 €",,,
https://www.awin1.com/pclick.php?p=27079248909&amp;a=357849&amp;m=9606,"Hi-Tec - Piumino smanicato arancione e nero",27079248909,9882602,https://images.asos-media.com/products/hi-tec-piumino-smanicato-arancione-e-nero/20030243-1-washedblack?$XXL$,"Smanicato di Hi-Tec Meglio senza maniche Modello ripiegabile Modello a blocchi di colore Chiusura con zip Tasche laterali Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Saldi &gt; Giacche e Cappotti",27.00,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fhi-tec-piumino-smanicato-arancione-e-nero%2F20030243-1-washedblack%3F%24XXL%24&amp;feedId=36675&amp;k=56358ea7d9f53a6f9fd42cba4340e9c60256afff,EUR,,0.00,https://www.asos.com/it/hi-tec/hi-tec-piumino-smanicato-arancione-e-nero/prd/20030243?browseCountry=IT&amp;browseCurrency=EUR,,,EUR27.00,36675,Hi-Tec,Nero,,7432,,,,,"60.00 €","0.00 €",,,
https://www.awin1.com/pclick.php?p=27733409907&amp;a=357849&amp;m=9606,"Gant - Piumino smanicato leggero blu navy",27733409907,10688333,https://images.asos-media.com/products/gant-piumino-smanicato-leggero-blu-navy/21647662-1-eveningblue?$XXL$,"Gilet di GANT Scopri i vantaggi Collo a imbuto Senza maniche Chiusura con zip Logo sul torace Tasche laterali con zip Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Giacche e cappotti &gt; Gilet",179.00,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fgant-piumino-smanicato-leggero-blu-navy%2F21647662-1-eveningblue%3F%24XXL%24&amp;feedId=36675&amp;k=e1ef9ecc2bd92d3ce801e01083b1592fa7991727,EUR,,0.00,https://www.asos.com/it/gant/gant-piumino-smanicato-leggero-blu-navy/prd/21647662?browseCountry=IT&amp;browseCurrency=EUR,,,EUR179.00,36675,Gant,Blu,,6422,,,,,"179.00 €","0.00 €",,,
https://www.awin1.com/pclick.php?p=26541790687&amp;a=357849&amp;m=16631,"GANT SMANICATO UOMO BEIGE",26541790687,232358,https://images.pricy.it/s/232358/or/159048177822.jpg,"Scopri l'Offerta GANT SMANICATO UOMO BEIGE ed Acquista al Miglior Prezzo!Descrizione: Smanicato reversibile, automatici, 2 tasche interne e 2 tasche interne, logoComposizione:TESSUTO ESTERNO: 60% ACRILICO 40% POLIESTERE. FODERA: 61% COTONE 39% POLIAMMIDE. IMBOTTITURA: 90% PIUMINO 10% PIUMAStagione: Autunno/Inverno",UOMO;Abbigliamento;Capispalla;Smanicati,164.60,"Pricy IT",16631,,0,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.pricy.it%2Fs%2F232358%2For%2F159048177822.jpg&amp;feedId=30757&amp;k=19920d0dfde75e326137169d071ccf2a8418fc4a,EUR,,0,https://www.awin1.com/pclick.php?p=26541790687&amp;a=357849&amp;m=16631,,,EUR164.60,30757,Gant,Beige,,6422,,,,,,466.50,,,
https://www.awin1.com/pclick.php?p=27721114437&amp;a=357849&amp;m=9606,"Free Country - Piumino smanicato grigio",27721114437,10411870,https://images.asos-media.com/products/free-country-piumino-smanicato-grigio/21095522-1-grey?$XXL$,"Gilet di Free Country Il prossimo articolo nei tuoi prodotti salvati Collo a imbuto Chiusura con zip Senza maniche Tasca con zip sul petto Tasche con zip ai lati Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Saldi &gt; Giacche e Cappotti",34.99,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Ffree-country-piumino-smanicato-grigio%2F21095522-1-grey%3F%24XXL%24&amp;feedId=36675&amp;k=1d16dcd04d35af7437e570868f8a3b3fac0bba9c,EUR,,0.00,https://www.asos.com/it/free-country/free-country-piumino-smanicato-grigio/prd/21095522?browseCountry=IT&amp;browseCurrency=EUR,,,EUR34.99,36675,"Free Country",Grigio,,26609,,,,,"34.99 €","70.99 €",,,
</code></pre>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60347</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60347</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 02 Dec 2020 17:37:45 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing word between commas not included in a list of words on Mon, 30 Nov 2020 15:24:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/fred-zept" aria-label="Profile: fred-zept">@<bdi>fred-zept</bdi></a> said in <a href="/post/60305">Replacing word between commas not included in a list of words</a>:</p>
<blockquote>
<p dir="auto">I tried your 3 steps suggestion but it does the opposite I need. It changes the words from the list in the word “altri”, and leave as they are any other word.</p>
</blockquote>
<p dir="auto">That is why it is so important that when you ask for search-and-replace help, you give both the data you <strong>have</strong> (“before”) and the way you <strong>want</strong> it to look when the transformation is complete (“after”).  If you <em>show</em> before and after data, rather than making us try to <em>interpret</em> what you might want from descriptions, it’s easier for us to check whether we got what you want or not.</p>
<p dir="auto">You’re already following some of the advice (thanks for <code>&lt;/&gt;</code> marking your example text as text! we appreciate it!), but I’ll quote my full boilerplate, just in case there’s more for you to glean:</p>
<p dir="auto">-—</p>
<p dir="auto"><em>Do you want regex search/replace help?  Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you.  All example text should be marked as plain text using the <code>&lt;/&gt;</code> toolbar button or manual <a href="https://community.notepad-plus-plus.org/topic/14262/how-to-markdown-code-on-this-forum/4">Markdown syntax</a>. Screenshots can be pasted from the clipboard to your post using <code>Ctrl+V</code> to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have <strong>and</strong> the text you want to get from that data; include examples of things that <strong>should match</strong> and be transformed, <strong>and</strong> things that <strong>don’t match</strong> and should be left alone; show <strong>edge cases</strong> and make sure you examples are as <strong>varied</strong> as your real data.  Show the regex you already tried, <strong>and why</strong> you thought it should work; tell us what’s wrong with what you <strong>do</strong> get… Read the official <a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">NPP Searching / Regex docs</a> and the forum’s <a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regex-documentation">Regular Expression FAQ</a>. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/60312</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60312</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 30 Nov 2020 15:24:31 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing word between commas not included in a list of words on Mon, 30 Nov 2020 14:27:01 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/fred-zept" aria-label="Profile: fred-zept">@<bdi>fred-zept</bdi></a></p>
<p dir="auto">Please, try the following regex, based in the expressions provided yesterday:</p>
<pre><code class="language-z">Search: ^((([^,]*),){22}(?!bianco|nero|rosso|giallo|blu|verde|arancione|grigio|viola|marrone|mimetico|beige|bordeaux))([^,]+)
Replace: ${1}altri
</code></pre>
<p dir="auto">Have fun!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60307</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60307</guid><dc:creator><![CDATA[astrosofista]]></dc:creator><pubDate>Mon, 30 Nov 2020 14:27:01 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing word between commas not included in a list of words on Mon, 30 Nov 2020 14:17:27 GMT]]></title><description><![CDATA[<p dir="auto">Hi guys, THANKS A LOT for your help. I’m sorry if I haven’t replied earlier, that’s the side effect of living on the other side of the planet.</p>
<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> Thanks Alan for your suggestion but it doesn’t seem to work on my text string.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry-r" aria-label="Profile: Terry-R">@<bdi>Terry-R</bdi></a> said in <a href="/post/60287">Replacing word between commas not included in a list of words</a>:</p>
<blockquote>
<p dir="auto">looks like a database record, possibly saved into a CSV file<br />
Correct, this is just one of the houndred thousand of lines that populates a CSV files.</p>
</blockquote>
<p dir="auto">Each line is a clothing item with its own color.<br />
The manufacturers have different standards for colours, of course they have the classic colours such as white, blue, yellow etc.<br />
Some of them have fancy names like “cosmic blue” or “burnt olive grey”.</p>
<p dir="auto">My goal is to target all the words that are not listed on the classic colours (bianco, rosso, giallo…) and replace them with the word “others” (altri).</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry-r" aria-label="Profile: Terry-R">@<bdi>Terry-R</bdi></a> said in <a href="/post/60287">Replacing word between commas not included in a list of words</a>:</p>
<blockquote>
<p dir="auto">Are you saying the word CANNOT be any from this list?<br />
Exactly, the word must be different from the list of the classic colours.</p>
</blockquote>
<p dir="auto">I tried your 3 steps suggestion but it does the opposite I need. It changes the words from the list in the word “altri”, and leave as they are any other word.</p>
<p dir="auto">Given the 5 strings below, I should get “altri” on the first two , and leave as they are the others.</p>
<p dir="auto">Thank you very much.</p>
<pre><code>https://www.awin1.com/pclick.php?p=27545432277&amp;a=357849&amp;m=9606,"Jack &amp; Jones - Piumino smanicato verde",27545432277,10376888,https://images.asos-media.com/products/jack-jones-piumino-smanicato-verde/21025644-1-dustyolive?$XXL$,"Gilet di Jack &amp; Jones Le maniche sono sopravvalutate Collo alto Senza maniche Chiusura con zip Logo applicato sul torace Tasche con zip ai lati Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Saldi &gt; Giacche e Cappotti",30.99,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fjack-jones-piumino-smanicato-verde%2F21025644-1-dustyolive%3F%24XXL%24&amp;feedId=36675&amp;k=c025ee86b55779a9b1bf35cda2bf257a5f636709,EUR,,0.00,https://www.asos.com/it/jack-jones/jack-jones-piumino-smanicato-verde/prd/21025644?browseCountry=IT&amp;browseCurrency=EUR,,,EUR30.99,36675,"jack &amp; jones",Cosmic,,23527,,,,,"30.99 €","56.99 €",,,
https://www.awin1.com/pclick.php?p=27577712641&amp;a=357849&amp;m=9606,"Hollister - Piumino smanicato nero con logo",27577712641,10445580,https://images.asos-media.com/products/hollister-piumino-smanicato-nero-con-logo/21162914-1-black?$XXL$,"Gilet di Hollister Le maniche sono sopravvalutate Modello imbottito Chiusura con zip Tasche laterali Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Giacche e cappotti &gt; Gilet",64.99,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fhollister-piumino-smanicato-nero-con-logo%2F21162914-1-black%3F%24XXL%24&amp;feedId=36675&amp;k=1947edd8eabd2ec2622a871a1440bb3de34d17f9,EUR,,0.00,https://www.asos.com/it/hollister/hollister-piumino-smanicato-nero-con-logo/prd/21162914?browseCountry=IT&amp;browseCurrency=EUR,,,EUR64.99,36675,Hollister,Violetto,,25563,,,,,"64.99 €","0.00 €",,,
https://www.awin1.com/pclick.php?p=27079248909&amp;a=357849&amp;m=9606,"Hi-Tec - Piumino smanicato arancione e nero",27079248909,9882602,https://images.asos-media.com/products/hi-tec-piumino-smanicato-arancione-e-nero/20030243-1-washedblack?$XXL$,"Smanicato di Hi-Tec Meglio senza maniche Modello ripiegabile Modello a blocchi di colore Chiusura con zip Tasche laterali Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Saldi &gt; Giacche e Cappotti",27.00,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fhi-tec-piumino-smanicato-arancione-e-nero%2F20030243-1-washedblack%3F%24XXL%24&amp;feedId=36675&amp;k=56358ea7d9f53a6f9fd42cba4340e9c60256afff,EUR,,0.00,https://www.asos.com/it/hi-tec/hi-tec-piumino-smanicato-arancione-e-nero/prd/20030243?browseCountry=IT&amp;browseCurrency=EUR,,,EUR27.00,36675,Hi-Tec,Nero,,7432,,,,,"60.00 €","0.00 €",,,
https://www.awin1.com/pclick.php?p=27733409907&amp;a=357849&amp;m=9606,"Gant - Piumino smanicato leggero blu navy",27733409907,10688333,https://images.asos-media.com/products/gant-piumino-smanicato-leggero-blu-navy/21647662-1-eveningblue?$XXL$,"Gilet di GANT Scopri i vantaggi Collo a imbuto Senza maniche Chiusura con zip Logo sul torace Tasche laterali con zip Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Giacche e cappotti &gt; Gilet",179.00,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fgant-piumino-smanicato-leggero-blu-navy%2F21647662-1-eveningblue%3F%24XXL%24&amp;feedId=36675&amp;k=e1ef9ecc2bd92d3ce801e01083b1592fa7991727,EUR,,0.00,https://www.asos.com/it/gant/gant-piumino-smanicato-leggero-blu-navy/prd/21647662?browseCountry=IT&amp;browseCurrency=EUR,,,EUR179.00,36675,Gant,Blu,,6422,,,,,"179.00 €","0.00 €",,,
https://www.awin1.com/pclick.php?p=26541790687&amp;a=357849&amp;m=16631,"GANT SMANICATO UOMO BEIGE",26541790687,232358,https://images.pricy.it/s/232358/or/159048177822.jpg,"Scopri l'Offerta GANT SMANICATO UOMO BEIGE ed Acquista al Miglior Prezzo!Descrizione: Smanicato reversibile, automatici, 2 tasche interne e 2 tasche interne, logoComposizione:TESSUTO ESTERNO: 60% ACRILICO 40% POLIESTERE. FODERA: 61% COTONE 39% POLIAMMIDE. IMBOTTITURA: 90% PIUMINO 10% PIUMAStagione: Autunno/Inverno",UOMO;Abbigliamento;Capispalla;Smanicati,164.60,"Pricy IT",16631,,0,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.pricy.it%2Fs%2F232358%2For%2F159048177822.jpg&amp;feedId=30757&amp;k=19920d0dfde75e326137169d071ccf2a8418fc4a,EUR,,0,https://www.awin1.com/pclick.php?p=26541790687&amp;a=357849&amp;m=16631,,,EUR164.60,30757,Gant,Beige,,6422,,,,,,466.50,,,
https://www.awin1.com/pclick.php?p=27721114437&amp;a=357849&amp;m=9606,"Free Country - Piumino smanicato grigio",27721114437,10411870,https://images.asos-media.com/products/free-country-piumino-smanicato-grigio/21095522-1-grey?$XXL$,"Gilet di Free Country Il prossimo articolo nei tuoi prodotti salvati Collo a imbuto Chiusura con zip Senza maniche Tasca con zip sul petto Tasche con zip ai lati Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Saldi &gt; Giacche e Cappotti",34.99,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Ffree-country-piumino-smanicato-grigio%2F21095522-1-grey%3F%24XXL%24&amp;feedId=36675&amp;k=1d16dcd04d35af7437e570868f8a3b3fac0bba9c,EUR,,0.00,https://www.asos.com/it/free-country/free-country-piumino-smanicato-grigio/prd/21095522?browseCountry=IT&amp;browseCurrency=EUR,,,EUR34.99,36675,"Free Country",Grigio,,26609,,,,,"34.99 €","70.99 €",,,


</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/60305</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60305</guid><dc:creator><![CDATA[fred zept]]></dc:creator><pubDate>Mon, 30 Nov 2020 14:17:27 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing word between commas not included in a list of words on Mon, 30 Nov 2020 00:26:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry-r" aria-label="Profile: Terry-R">@<bdi>Terry-R</bdi></a> said in <a href="/post/60289">Replacing word between commas not included in a list of words</a>:</p>
<blockquote>
<p dir="auto">So even though I could correctly idenity the 22nd/23rd comma what I’m unable to do successfully is replace the field if one of those words exist.</p>
</blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> You may be wondering why I broke this into a number of steps. My original regex was a combination of 1. and 2. and I had the dreaded buffer overflow issue (presumably?), the whole file contents were selected. On the first find it worked, then second find grabbed all the file contents. The one we normally ONLY see when there are a large number of lines with a rarity of the values we are looking for in a lookahead. I don’t understand why since I only had 3 lines I was testing on, of which only 1 (1st test line) had one of the key words.</p>
<p dir="auto">I’ve never had this issue before on such a small test set and wondered if any of you might be able to shed light on it. I do suspect it might be related to the <code>{22}</code> in my regex, but that’s the extent of my thoughts. Given the problem it was just easier to break the solution in multiple steps.</p>
<p dir="auto">Terry</p>
<p dir="auto">PS in case you wanted to see exactly what I was using here it is:</p>
<pre><code>https://url.com,,27305664219,10300104,https://images.url.com/products/jacket-original-piumino-smanicato-grigio-colorblock/20870943-1-asphalt?$XXL$,"Gilet di Brand Bello indossare una giacca nuova! Modello a blocchi di colore Collo a imbuto Chiusura con zip Etichetta con logo Tasche laterali Vestibilità classica Veste perfettamente la taglia indicata",,38.99,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fjack-jones-originals-piumino-smanicato-grigio-colorblock%2F20870943-1-asphalt%3F%24XXL%24&amp;feedId=36675&amp;k=40c130faec57ad6220fdad81baad41e935cc3845,EUR,,0.00,https://www.asos.com/it/jack-jones/jack-jones-originals-piumino-smanicato-grigio-colorblock/prd/20870943?browseCountry=IT&amp;browseCurrency=EUR,text here,,EUR38.99,36675,"jack &amp; jones",Grigio,,23527,,,,,"38.99 €","0.00 €",,,
https://url.com,"text - text",27305664219,,,"Gilet di Brand Bello indossare una giacca nuova! Modello a blocchi di, colore Collo, a imbuto Chiusura con zip Etichetta con logo Tasche laterali Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Giacche e Cappotti &gt; Gilet",,"Asos.com IT",9606,"Men's Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fjack-jones-originals-piumino-smanicato-grigio-colorblock%2F20870943-1-asphalt%3F%24XXL%24&amp;feedId=36675&amp;k=40c130faec57ad6220fdad81baad41e935cc3845,EUR,,0.00,https://www.asos.com/it/jack-jones/jack-jones-originals-piumino-smanicato-grigio-colorblock/prd/20870943?browseCountry=IT&amp;browseCurrency=EUR,,,,,"jack &amp; jones",Grigo,,23527,,,,,"38.99 €","0.00 €",,,
https://url.com,"text - text",27305664219,10300104,https://images.url.com/products/jacket-original-piumino-smanicato-grigio-colorblock/20870943-1-asphalt?$XXL$,"Gilet di Brand Bello indossare una giacca nuova! Modello a blocchi di colore Collo a imbuto Chiusura con zip Etichetta con, logo Tasche laterali Vestibilità classica Veste perfettamente la taglia indicata","Uomo &gt; Giacche e Cappotti &gt; Gilet",38.99,"Asos.com IT,",9606,"Men's, Outerwear",171,https://images2.productserve.com/?w=200&amp;h=200&amp;bg=white&amp;trim=5&amp;t=letterbox&amp;url=ssl%3Aimages.asos-media.com%2Fproducts%2Fjack-jones-originals-piumino-smanicato-grigio-colorblock%2F20870943-1-asphalt%3F%24XXL%24&amp;feedId=36675&amp;k=40c130faec57ad6220fdad81baad41e935cc3845,EUR,,0.00,https://www.asos.com/it/jack-jones/jack-jones-originals-piumino-smanicato-grigio-colorblock/prd/20870943?browseCountry=IT&amp;browseCurrency=EUR,,,EUR38.99,36675,"jack, &amp; jones",,,23527,,,,,"38.99 €","0.00 €",,,
</code></pre>
<p dir="auto">and the Find What regex was <code>(?-s)^(("?)[^"\r\n]*?\2,){22}(bianco|nero|rosso|giallo|blu|verde|arancione|grigio|viola|marrone|beige|bordeaux)</code><br />
I added the <code>\r\n</code> in another attempt, but the same result, whole file selected on 2nd find. Note the 2nd line has Grigo, not Grigio, I removed the <code>i</code>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60290</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60290</guid><dc:creator><![CDATA[Terry R]]></dc:creator><pubDate>Mon, 30 Nov 2020 00:26:41 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing word between commas not included in a list of words on Sun, 29 Nov 2020 23:40:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/fred-zept" aria-label="Profile: fred-zept">@<bdi>fred-zept</bdi></a> said in <a href="/post/60286">Replacing word between commas not included in a list of words</a>:</p>
<blockquote>
<p dir="auto">below the text I’d wish to get help with.</p>
</blockquote>
<p dir="auto">Anytime a text field occurs in this situation that has quotes (<code>"</code>) around it, it can mean that the field may include the same character as is used to delimit the field, in this case the comma (<code>,</code>). I’ve been doing some testing to determine how to exclude the <code>,</code> within text fields, yet be able to count the number of fields correctly. I think I now have that sorted. So the next step was to identify the records which contain one of the list of words you provided and replace ONLY that field with “altri” which is what I assume you mean.</p>
<p dir="auto">I think the first issue I had was understanding what you mean. I recall we had a similar issue with a previous post of your’s trying to understand “near duplicates”.</p>
<p dir="auto">So even though I could correctly idenity the 22nd/23rd comma what I’m unable to do successfully is replace the field if one of those words exist. So what I think is a better option is to split the process up into a number of steps.</p>
<ol>
<li>Split the lines at the 22nd field, so that any of the possible words will be at the start of a line.</li>
<li>Identify those lines and replace ONLY that field.</li>
<li>Combine the split lines back together.</li>
</ol>
<p dir="auto">So we have:</p>
<ol>
<li>
<p dir="auto">Use the Replace function<br />
Find What:<code>(?-s)^(("?)[^"]*?\2,){22}</code><br />
Replace With:<code>$0=\r\n=</code></p>
</li>
<li>
<p dir="auto">Use the Replace function to find any of the words listed and replace them.<br />
Find What:<code>^=(bianco|nero|rosso|giallo|blu|verde|arancione|grigio|viola|marrone|beige|bordeaux)</code><br />
Replace With:<code>=Altri</code></p>
</li>
<li>
<p dir="auto">Combine the lines back together.<br />
Use the Replace Function<br />
Find What:<code>=(\R)=</code><br />
Replace With:  empty field here.</p>
</li>
</ol>
<p dir="auto">Hope this helps.<br />
Terry</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60289</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60289</guid><dc:creator><![CDATA[Terry R]]></dc:creator><pubDate>Sun, 29 Nov 2020 23:40:26 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing word between commas not included in a list of words on Sun, 29 Nov 2020 22:16:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/fred-zept" aria-label="Profile: fred-zept">@<bdi>fred-zept</bdi></a></p>
<p dir="auto">I might be tempted to solve it with a simpler scenario that could be translated to yours.</p>
<p dir="auto">Start with this comma-separated list of names:</p>
<pre><code class="language-z">bill,bob,joe,steve,alan,karen,ryan,carolyn
bob,joe,steve,alan,karen,ryan,carolyn,bill
joe,steve,alan,karen,ryan,carolyn,bill,bob
steve,alan,karen,ryan,carolyn,bill,bob,joe
</code></pre>
<p dir="auto">Say we want to replace the name after the 3rd comma with <code>JIMMY</code>, but only if the name that is currently there is not <code>alan</code> nor <code>karen</code>.</p>
<p dir="auto">So if we use this replacement:</p>
<p dir="auto">find: <code>^((([^,]+),){3}(?!alan|karen))([^,]+)</code><br />
repl: <code>${1}JIMMY</code><br />
search mode: reg expr</p>
<p dir="auto">We obtain:</p>
<pre><code class="language-z">bill,bob,joe,JIMMY,alan,karen,ryan,carolyn
bob,joe,steve,alan,karen,ryan,carolyn,bill
joe,steve,alan,karen,ryan,carolyn,bill,bob
steve,alan,karen,JIMMY,carolyn,bill,bob,joe
</code></pre>
<p dir="auto">It is not that difficult to translate that solution into one that would meet your need, as described, unless of course something has been misrepresented or additional complications such as those Terry mentions occur.</p>
<p dir="auto">Note also that I didn’t use “non-capturing” parentheses in certain places I could have.  For people new to regular expressions, that just makes it harder to look at and decipher.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60288</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60288</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sun, 29 Nov 2020 22:16:10 GMT</pubDate></item><item><title><![CDATA[Reply to Replacing word between commas not included in a list of words on Sun, 29 Nov 2020 21:59:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/fred-zept" aria-label="Profile: fred-zept">@<bdi>fred-zept</bdi></a> said in <a href="/post/60286">Replacing word between commas not included in a list of words</a>:</p>
<blockquote>
<p dir="auto">I’m wondering whether it is possible to replace any word, between the 22nd and the 23rd comma, different from these list of words</p>
</blockquote>
<p dir="auto">Your 1 example line looks like a database record, possibly saved into a CSV file. I note that one of the fields is a text field and has <code>"</code> around it. Because of that it won’t be a simple task of counting the number of commas as any within the text fields must be excluded. That will complicate any solution. However I also note that there is the “euro” sign beyond where you want to insert a word so possibly that could be used as a reference. Could you provide the same example line with the word you do want to insert. it would help to know exactly where this position is and possibly also a bit more about what words you want to use.</p>
<p dir="auto">You also ask whether any word “different from a list of words”, what do you mean. Are you saying the word CANNOT be any from this list? Given the regular expression needs to know what word it WILL use, excluding words is not a problem. How do you determine what word you DO want to use?</p>
<p dir="auto">Terry</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60287</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60287</guid><dc:creator><![CDATA[Terry R]]></dc:creator><pubDate>Sun, 29 Nov 2020 21:59:59 GMT</pubDate></item></channel></rss>