<?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[Search &amp; Replace regex]]></title><description><![CDATA[<p dir="auto">Good day,</p>
<p dir="auto">I am trying to do a Search &amp; Replace on text file to invert some text:</p>
<p dir="auto">“T3A”,“LC0721”,“LC0721”,“CALGARY LCD 11”,“60”,“197”,“”,“”,“HAI025 1-AB”,“Disc menu EN”<br />
“T3A”,“LC0724”,“LC0724”,“CALGARY LCD 11”,“218”,“22”,“”,“”,“HAI025 1-AB”,“Disc menu EN”</p>
<p dir="auto">I want the section “HAI025 1-AB” to become “1-AB HAI025”. I am using the<br />
Regular expression selected:</p>
<p dir="auto">Find what: (\HAI…) (.*?")<br />
Replace with : \2 \1</p>
<p dir="auto">Results:</p>
<p dir="auto">“T3A”,“LC0721”,“LC0721”,“CALGARY LCD 11”,“60”,“197”,“”,“”,“1-AB” HAI025,“Disc menu EN”<br />
“T3A”,“LC0724”,“LC0724”,“CALGARY LCD 11”,“218”,“22”,“”,“”,“1-AB” HAI025,“Disc menu EN”</p>
<p dir="auto">I am getting that extra quote " after the AB where I would to get just a space and the quote " at the end of that field before the comma.</p>
<p dir="auto">How do I substract the last character from the \1 and add that extra quote at the end?</p>
<p dir="auto">Tx for your help,</p>
<p dir="auto">Yves</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/22881/search-replace-regex</link><generator>RSS for Node</generator><lastBuildDate>Mon, 10 Aug 2026 22:34:51 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/22881.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Apr 2022 20:46:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Search &amp; Replace regex on Wed, 20 Apr 2022 21:05:55 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/76205">Search &amp; Replace regex</a>:</p>
<blockquote>
<p dir="auto">(?-is)“(HAI…) (.*?)”</p>
</blockquote>
<p dir="auto">Tx Alan</p>
<p dir="auto">Your solution works perfectly. Very very new at using notepad++ to modify data. Usually a database (access, foxpro, filemaker) or excel. But the supplier (Canada Post) gave me csv files, it is much simpler to keep them almost as they were supplied to me.</p>
<p dir="auto">Tx</p>
<p dir="auto">Yves</p>
]]></description><link>https://community.notepad-plus-plus.org/post/76206</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/76206</guid><dc:creator><![CDATA[Yves Davignon]]></dc:creator><pubDate>Wed, 20 Apr 2022 21:05:55 GMT</pubDate></item><item><title><![CDATA[Reply to Search &amp; Replace regex on Wed, 20 Apr 2022 20:56:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/yves-davignon" aria-label="Profile: yves-davignon">@<bdi>yves-davignon</bdi></a></p>
<p dir="auto">Why not just change it to?:</p>
<p dir="auto">Find: <code>(?-is)"(HAI...) (.*?)"</code><br />
Replace: <code>"\2 \1"</code><br />
Search mode: Regular expression</p>
<p dir="auto">That will take this data:</p>
<pre><code>"T3A","LC0721","LC0721","CALGARY LCD 11","60","197","","","HAI025 1-AB","Disc menu EN"
"T3A","LC0724","LC0724","CALGARY LCD 11","218","22","","","HAI025 1-AB","Disc menu EN"
</code></pre>
<p dir="auto">to this:</p>
<pre><code>"T3A","LC0721","LC0721","CALGARY LCD 11","60","197","","","1-AB HAI025","Disc menu EN"
"T3A","LC0724","LC0724","CALGARY LCD 11","218","22","","","1-AB HAI025","Disc menu EN"
</code></pre>
<p dir="auto">Note: I tried to keep the spirit of your original expression, because I don’t know how else your data looks.</p>
<p dir="auto">BTW, not sure why you escaped the <code>H</code> (as <code>\H</code>) because <code>\H</code> doesn’t mean <code>H</code>, it means “a single character that is not horizontal whitespace”.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/76205</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/76205</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 20 Apr 2022 20:56:34 GMT</pubDate></item></channel></rss>