<?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[Adding } to the end of a text line]]></title><description><![CDATA[<p dir="auto">Hello,<br />
I do Need a Little help with regular expressions.<br />
I have a utf-8 textr file with thousands of entries</p>
<p dir="auto">synonyms are looking like this: {Basel-City}.</p>
<p dir="auto">Due to a error the look kike this: {Basel-Country or {Northwestern Switzerland</p>
<p dir="auto">Is there a way to find this two Kind of occurrences and replace it with the first part + }</p>
<p dir="auto">Thanks a lot for your help.<br />
Uwe</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/14741/adding-to-the-end-of-a-text-line</link><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 17:39:53 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/14741.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 05 Nov 2017 13:20:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Adding } to the end of a text line on Tue, 07 Nov 2017 23:01:26 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/uwe-helmer" aria-label="Profile: uwe-helmer">@<bdi>uwe-helmer</bdi></a>,</p>
<p dir="auto">Ah, OK ! Sorry for my <strong>late</strong> reply, but I was studying the <strong>haunting</strong> problem of the <strong>suppression</strong> of <strong>duplicate</strong> lines, <strong>without</strong> corrupting the <strong>order</strong> of the file contents :-)) See, below :</p>
<p dir="auto"><a href="https://notepad-plus-plus.org/community/topic/14729/deleting-lines-that-repeat-the-first-15-characters/13" rel="nofollow ugc">https://notepad-plus-plus.org/community/topic/14729/deleting-lines-that-repeat-the-first-15-characters/13</a></p>
<hr />
<p dir="auto">So, let’s consider your <strong>example</strong> text, below, in a <strong>new</strong> tab :</p>
<pre><code class="language-diff">{Ausgang
{door
{Eingang}
{Eintritt}
{entry
{exit}
{gate}
{gateway}
{ingress
{Pforte}
{Portal}
{slammer}
{Tor
{Türe}
{Zugang}
Gatter
Tor
Torbogen
Treppen
Stufen
Wände
Gelaender
{banister
{handrail}
{railing}
Innenraum
{interior}
</code></pre>
<p dir="auto">Open the <strong>Replace</strong> dialog ( <strong><code>Ctrl + H</code></strong> )</p>
<p dir="auto">Check the <strong>Regular expression</strong>  search mode</p>
<p dir="auto">SEARCH <strong><code>(?-s)^\{.*[^}\r\n](?=\R)</code></strong></p>
<p dir="auto">REPLACE <strong><code>$0}</code></strong></p>
<p dir="auto">Click, once, on the <strong>Replace All</strong> button ( or, successively, on the <strong>Replace</strong> button )</p>
<p dir="auto">=&gt; You should get the text :</p>
<pre><code class="language-diff">{Ausgang}
{door}
{Eingang}
{Eintritt}
{entry}
{exit}
{gate}
{gateway}
{ingress}
{Pforte}
{Portal}
{slammer}
{Tor}
{Türe}
{Zugang}
Gatter
Tor
Torbogen
Treppen
Stufen
Wände
Gelaender
{banister}
{handrail}
{railing}
Innenraum
{interior}
</code></pre>
<p dir="auto">Et voilà !</p>
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">First, the <strong><code>(?-s)</code></strong> <strong>modifier</strong> forces the regex engine to interpret the special <strong><code>.</code></strong> character as matching a <strong>single standard</strong> character, only</p>
</li>
<li>
<p dir="auto">Then, the part <strong><code>^\{</code></strong> looks the <strong><code>\{</code></strong> character, at <strong>beginning</strong> of line <strong><code>^</code></strong>. Note that the special <strong><code>{</code></strong> regex character have to be <strong>escaped</strong> !</p>
</li>
<li>
<p dir="auto">Now, the part <strong><code>.*</code></strong> searches any amount, even <strong>empty</strong>, of <strong>standard</strong> characters, till …</p>
</li>
<li>
<p dir="auto">A character <strong>different</strong> from the <strong><code>}</code></strong> character ( part <strong><code>[^}\r\n]</code></strong> ) which is followed by <strong>EOL</strong> characters ( <strong>look-ahead</strong> feature <strong><code>(?=\R) </code></strong> )</p>
<ul>
<li>
<p dir="auto">The part <strong><code>[^}\r\n]</code></strong> is a <strong>negative character class</strong>, looking for <strong>any</strong> character, <strong>different</strong> from, either, the <strong><code>}</code></strong> character, the <strong>EOL</strong> character <strong><code>\r</code></strong> and the <strong>EOL</strong> character <strong><code>\n</code></strong></p>
</li>
<li>
<p dir="auto">The <strong><code>\R</code></strong> stands for any kind of <strong>line break</strong> ( <strong><code>\r\n</code></strong>, <strong><code>\n</code></strong> or <strong><code>\r</code></strong> )</p>
</li>
</ul>
</li>
<li>
<p dir="auto">In <strong>replacement</strong>, it rewrites the <strong>overall matched</strong> string <strong><code>$0</code></strong>, simply <strong>followed</strong> by the <strong><code>}</code></strong> character</p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27919</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27919</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 07 Nov 2017 23:01:26 GMT</pubDate></item><item><title><![CDATA[Reply to Adding } to the end of a text line on Mon, 06 Nov 2017 22:31:54 GMT]]></title><description><![CDATA[<p dir="auto">Hi guy038,<br />
it is always CR and LF. Sometimes the closing } is missing. Whereever I have a { I do Need a closing } before the CR and LF.</p>
<p dir="auto">{Ausgang<br />
{door<br />
{Eingang}<br />
{Eintritt}<br />
{entry<br />
{exit}<br />
{gate}<br />
{gateway}<br />
{ingress<br />
{Pforte}<br />
{Portal}<br />
{slammer}<br />
{Tor<br />
{Türe}<br />
{Zugang}<br />
Gatter<br />
Tor<br />
Torbogen<br />
Treppen<br />
Stufen<br />
Wände<br />
Gelaender<br />
{banister<br />
{handrail}<br />
{railing}<br />
Innenraum<br />
{interior}</p>
<p dir="auto">Thanks a lot.<br />
Uwe</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27905</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27905</guid><dc:creator><![CDATA[Uwe Helmer]]></dc:creator><pubDate>Mon, 06 Nov 2017 22:31:54 GMT</pubDate></item><item><title><![CDATA[Reply to Adding } to the end of a text line on Sun, 05 Nov 2017 14:39:27 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/uwe-helmer" aria-label="Profile: uwe-helmer">@<bdi>uwe-helmer</bdi></a>,</p>
<p dir="auto">Seemingly, the part, inside your <strong><code>{....}</code></strong> entries, is a <strong>range</strong> of characters, made up of :</p>
<ul>
<li>
<p dir="auto">Normal word character, ( <strong>upper</strong> or <strong>lower</strong>-case letter or <strong>accentuated</strong> one, <strong>digit</strong> or the <strong>low-line</strong> character <strong><code>_</code></strong>)  =&gt; <strong><code>\w</code></strong></p>
</li>
<li>
<p dir="auto">The <strong>dash-minus</strong> character <strong><code>-</code></strong>, as, for instance, in the string <strong>Basel-Country</strong></p>
</li>
<li>
<p dir="auto">The <strong>space</strong> character, as, for instance, in the string <strong>Northwestern Switzerland</strong></p>
</li>
</ul>
<p dir="auto">So, the <strong>question</strong> is : in your present file, <strong>which</strong> character(s) is/are assumed to be <strong>after</strong> an <strong>unbalanced</strong> entry <strong><code>{....</code></strong> ?</p>
<p dir="auto"><strong>Once</strong>, this/these character(s) known ( it may be usual <strong>End of Line</strong> characters, BTW ), it should be easy to find out the <strong>right</strong> regex, to get <strong>well-balanced</strong> entries <strong><code>{....}</code></strong>, again !</p>
<p dir="auto">You may also insert a <strong>small</strong> part of your text, in your <strong>next</strong> post !</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/27861</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/27861</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 05 Nov 2017 14:39:27 GMT</pubDate></item></channel></rss>