<?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[convert lower to upper and upper to lower aftert colon]]></title><description><![CDATA[<p dir="auto">** hi, i have text file like:</p>
<pre><code>john:abc232
smith:Snlf1999
</code></pre>
<p dir="auto">i want it to be</p>
<pre><code>john:Abc232
smith:snlf1999
</code></pre>
<p dir="auto">i used<br />
to search</p>
<pre><code>(?-s)(?&lt;=:)(.)(.*?)
</code></pre>
<p dir="auto">and replace with</p>
<pre><code>\u\1\L\2
</code></pre>
<p dir="auto">and this did the job for change all to upper case, now i want to go back to lowercase but i couldn’t find a way.</p>
<p dir="auto">also, the main goal was to convert lower to upper and upper to lower in the same time.</p>
<p dir="auto">Thanks in advance. **</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/19483/convert-lower-to-upper-and-upper-to-lower-aftert-colon</link><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 10:55:17 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/19483.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 31 May 2020 17:24:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to convert lower to upper and upper to lower aftert colon on Sun, 31 May 2020 22:58:43 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/real_1bx" aria-label="Profile: real_1bx">@<bdi>real_1bx</bdi></a>, and <strong>All</strong>,</p>
<p dir="auto">This time, due to the <strong>simultaneous</strong> search of an <strong>entire</strong> line, with its <strong>line-break</strong>, when a <strong>digit</strong> follows the <strong>colon</strong> char, we need, again, <strong>two</strong> groups, leading up to that <strong>regex</strong> S/R :</p>
<p dir="auto">SEARCH <strong><code>(?-is)^.+:\d.+\R|((:[A-Z])|:[a-z])</code></strong></p>
<p dir="auto">REPLACE <strong><code>?1(?2\L:\U)\1</code></strong></p>
<p dir="auto">For instance, the <strong>input</strong> text, below :</p>
<pre><code class="language-diff">john:abC232
john:13kkmsd
smith:SnLf1999
</code></pre>
<p dir="auto">would be <strong>modified</strong> as :</p>
<pre><code class="language-diff">john:AbC232
smith:snLf1999
</code></pre>
<p dir="auto">Best regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54481</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54481</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 31 May 2020 22:58:43 GMT</pubDate></item><item><title><![CDATA[Reply to convert lower to upper and upper to lower aftert colon on Sun, 31 May 2020 21:05:53 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> is it possible to delete whole line if there is number after the :<br />
i mean the first character after colon not the whole word.<br />
like</p>
<pre><code>abc:fkls
john:13kkmsd
smith:kmskl
```
**to be**

```
abc:fkls
smith:kmskl
```</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/54479</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54479</guid><dc:creator><![CDATA[real_1bx]]></dc:creator><pubDate>Sun, 31 May 2020 21:05:53 GMT</pubDate></item><item><title><![CDATA[Reply to convert lower to upper and upper to lower aftert colon on Sun, 31 May 2020 19:13:45 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/real_1bx" aria-label="Profile: real_1bx">@<bdi>real_1bx</bdi></a>,</p>
<p dir="auto">I hope that you noticed <strong>why</strong> I use, this time, the <strong><code>(?1\L:\U)$0</code></strong> syntax ( and <strong>not</strong> <strong><code>(?1\l:\u)$0</code></strong> ), in replacement ?</p>
<p dir="auto">Just because the string to convert in <strong>upper / lower</strong> case ( <strong><code>$0</code></strong> ) is <strong>two</strong> chars long ( a colon <strong><code>:</code></strong> + a <strong>letter</strong> ) !</p>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54477</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54477</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 31 May 2020 19:13:45 GMT</pubDate></item><item><title><![CDATA[Reply to convert lower to upper and upper to lower aftert colon on Sun, 31 May 2020 18:58:46 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><br />
Thank you very much , that’s saved me a LOT of time.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54476</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54476</guid><dc:creator><![CDATA[real_1bx]]></dc:creator><pubDate>Sun, 31 May 2020 18:58:46 GMT</pubDate></item><item><title><![CDATA[Reply to convert lower to upper and upper to lower aftert colon on Sun, 31 May 2020 18:55:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/real_1bx" aria-label="Profile: real_1bx">@<bdi>real_1bx</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"><strong>Last</strong> news : we don’t <strong>even</strong> need an <strong>outer</strong> group to capture the <strong>letter</strong>  ! So, why not this <strong>attempt</strong> :</p>
<p dir="auto">SEARCH <strong><code>(?-i)(:[A-Z])|:[a-z]</code></strong></p>
<p dir="auto">REPLACE <strong><code>(?1\L:\U)$0</code></strong></p>
<hr />
<p dir="auto">So the following text :</p>
<pre><code class="language-diff">john:abC232
smith:SnLf1999
</code></pre>
<p dir="auto">becomes :</p>
<pre><code class="language-diff">john:AbC232
smith:snLf1999
</code></pre>
<p dir="auto">BR,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54475</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54475</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 31 May 2020 18:55:32 GMT</pubDate></item><item><title><![CDATA[Reply to convert lower to upper and upper to lower aftert colon on Sun, 31 May 2020 18:42:12 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/real_1bx" aria-label="Profile: real_1bx">@<bdi>real_1bx</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">So, I did the <strong>same</strong> mistake as <strong>Peter</strong> !</p>
<p dir="auto">Thus, my <strong>regex</strong> S/R should be <strong>modified</strong> as :</p>
<p dir="auto">SEARCH <strong><code>(?-i):(([A-Z])|[a-z])</code></strong></p>
<p dir="auto">REPLACE <strong><code>:(?2\l:\u)\1</code></strong></p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54474</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54474</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 31 May 2020 18:42:12 GMT</pubDate></item><item><title><![CDATA[Reply to convert lower to upper and upper to lower aftert colon on Sun, 31 May 2020 18:26:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/real_1bx" aria-label="Profile: real_1bx">@<bdi>real_1bx</bdi></a> said in <a href="/post/54470">convert lower to upper and upper to lower aftert colon</a>:</p>
<blockquote>
<p dir="auto">Thank you very much, i really do appropriate taking time to help me out.<br />
the logic is i want colon-lowercase to become colon-uppercase, and colon-uppercase to become colon-lowercase <em><strong>but</strong></em> everything after that stay the same i don’t want change it.</p>
</blockquote>
<p dir="auto">Ahh, your <code>\L</code> confused me to thinking you wanted the rest lowercase.</p>
<p dir="auto">Just get rid of the third group in find and replace should do it:</p>
<p dir="auto">FIND = <code>(?-is)(?&lt;=:)(?:([a-z])|([A-Z]))</code><br />
REPLACE = <code>(?1\u$1)(?2\l$2)</code><br />
MODE = regular expression</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54472</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54472</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sun, 31 May 2020 18:26:39 GMT</pubDate></item><item><title><![CDATA[Reply to convert lower to upper and upper to lower aftert colon on Sun, 31 May 2020 18:29:47 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/real_1bx" aria-label="Profile: real_1bx">@<bdi>real_1bx</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">You need to <strong>distinguish</strong> an <strong>uppercase</strong> letter from a <strong>lowercase</strong> letter !</p>
<p dir="auto">So, I think that the following <strong>regex</strong> S/R should work !</p>
<p dir="auto">SEARCH <strong><code>(?-is):(([A-Z])|[a-z])(.+)</code></strong></p>
<p dir="auto">REPLACE <strong><code>:(?2\l:\u)\1\L\3</code></strong></p>
<p dir="auto">For instance, the text :</p>
<pre><code class="language-diff">john:abC232
smith:SnLf1999
</code></pre>
<p dir="auto">is changed into :</p>
<pre><code class="language-diff">john:Abc232
smith:snlf1999
</code></pre>
<hr />
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">First, the <strong>in-line</strong> modifiers <strong><code>(?-is)</code></strong> means that :</p>
<ul>
<li>
<p dir="auto">The <strong>search</strong> will be carried on, in a <strong>non-insensitive</strong> way ( <strong><code>-i</code></strong> )</p>
</li>
<li>
<p dir="auto">Any regex <strong>dot</strong> symbol matches a <strong>single standard</strong> character <strong>only</strong> ( and <strong>not</strong> <em>line-break</em> chars )</p>
</li>
</ul>
</li>
<li>
<p dir="auto"><strong>Groups</strong> involved in the <strong>search</strong> regex are :</p>
<ul>
<li>
<p dir="auto"><strong>Group <code>1</code></strong> = <strong><code>([A-Z])|[a-z]</code></strong>, so the <strong>first</strong> letter after the <strong><code>:</code></strong> char, which may be, either a lower-case or an upper-case letter</p>
</li>
<li>
<p dir="auto"><strong>Group <code>2</code></strong> = <strong><code>[A-Z]</code></strong>, so the first <strong>upper-case</strong> letter after the <strong><code>:</code></strong></p>
</li>
<li>
<p dir="auto"><strong>Group <code>3</code></strong> = <strong><code>.+</code></strong>, so all the <strong>remaining</strong> characters of <strong>current</strong> line, after the <strong><code>:</code></strong> and a <strong>first</strong> letter</p>
</li>
</ul>
</li>
<li>
<p dir="auto">In the <strong>replacement</strong> regex :</p>
<ul>
<li>
<p dir="auto"><strong><code>:</code></strong> rewrites the <strong>colon</strong>, first</p>
</li>
<li>
<p dir="auto">Then, the <strong><code>(?2\l:\u)</code></strong> syntax is a <strong>conditional</strong> structure which forces the <strong>next</strong> character to be written :</p>
<ul>
<li>
<p dir="auto">In <strong>lower</strong> case if <strong>group <code>2</code></strong> exists, that is to say if an <strong>upper</strong> case letter has matched</p>
</li>
<li>
<p dir="auto">In <strong>upper</strong> case if <strong>group <code>2</code></strong> does <strong>not</strong> exist =&gt; a <strong>lower</strong> case letter has matched</p>
</li>
</ul>
</li>
<li>
<p dir="auto"><strong><code>\1</code></strong> is the first letter whose <strong>case</strong> has been <strong>modified</strong></p>
</li>
<li>
<p dir="auto">Finally, <strong><code>\L\3</code></strong> rewrites all the <strong>remaining</strong> characters, of <strong>current</strong> line,  in <strong>lower-case</strong></p>
</li>
</ul>
</li>
<li>
<p dir="auto">Note that I do <strong>not</strong> use the <strong>look-behind</strong> structure <strong><code>(?&lt;=:)</code></strong> which enable us to use the <strong>step by step</strong> replacement with <strong>repeated</strong> hits on the <strong><code>Replace </code></strong> button</p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a> said :</p>
<blockquote>
<p dir="auto">I am surprised <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> hadn’t chimed in already, since he was around a few minutes ago.</p>
</blockquote>
<p dir="auto">Well, I was chatting for a moment with my <strong>son</strong> who’s going back to <strong>Lyon</strong> ;-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54471</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54471</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 31 May 2020 18:29:47 GMT</pubDate></item><item><title><![CDATA[Reply to convert lower to upper and upper to lower aftert colon on Sun, 31 May 2020 18:04:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said in <a href="/post/54468">convert lower to upper and upper to lower aftert colon</a>:</p>
<blockquote>
<p dir="auto">If I am understanding the logic, you want colon-lowercase to become colon-uppercase, and colon-uppercase to become colon-lowercase, and everything after that to be made lowercase, right?  If so, then I think this will work for you:</p>
</blockquote>
<p dir="auto">Thank you very much, i really do appropriate taking time to help me out.<br />
the logic is i want colon-lowercase to become colon-uppercase, and colon-uppercase to become colon-lowercase <em><strong>but</strong></em> everything after that stay the same i don’t want change it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54470</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54470</guid><dc:creator><![CDATA[real_1bx]]></dc:creator><pubDate>Sun, 31 May 2020 18:04:47 GMT</pubDate></item><item><title><![CDATA[Reply to convert lower to upper and upper to lower aftert colon on Sun, 31 May 2020 18:04:11 GMT]]></title><description><![CDATA[<p dir="auto">FYI:</p>
<p dir="auto">The official docs have a section on substitution regex, but the conditional replacements were not explained: <a href="https://npp-user-manual.org/docs/searching/#substitutions" rel="nofollow ugc">https://npp-user-manual.org/docs/searching/#substitutions</a></p>
<p dir="auto">The most recent update to the documentation github has more details on that; it will be in the next release to the doc website (whenever that occurs): <a href="https://github.com/notepad-plus-plus/npp-usermanual/blob/852b4ac8a2e667be027d3f7db0a04cfeb2d71eca/content/docs/searching.md#substitution-conditionals" rel="nofollow ugc">https://github.com/notepad-plus-plus/npp-usermanual/blob/852b4ac8a2e667be027d3f7db0a04cfeb2d71eca/content/docs/searching.md#substitution-conditionals</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/54469</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54469</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sun, 31 May 2020 18:04:11 GMT</pubDate></item><item><title><![CDATA[Reply to convert lower to upper and upper to lower aftert colon on Sun, 31 May 2020 18:00:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/real_1bx" aria-label="Profile: real_1bx">@<bdi>real_1bx</bdi></a> ,</p>
<p dir="auto">Thanks for showing what you have, what you want, and what you’ve tried.  That makes it so much nicer to try to help you.</p>
<p dir="auto">If I am understanding the logic, you want colon-lowercase to become colon-uppercase, and colon-uppercase to become colon-lowercase, and everything after that to be made lowercase, right?  If so, then I think this will work for you:</p>
<ul>
<li>FIND = <code>(?-is)(?&lt;=:)(?:([a-z])|([A-Z]))(.*)</code></li>
<li>REPLACE = <code>(?1\u$1)(?2\l$2)\L$3\E</code></li>
<li>MODE = regular expression</li>
<li>REPLACE ALL (with the look behind, replace-one-at-a-time doesn’t seem to work)</li>
</ul>
<p dir="auto">My thought process: I want it to be able to differentiate lowercase and uppercase in two different “if” conditions, so wrap the first character after the colon as an alternation, with group1 being lowercase, group2 being uppercase; then put everything else (greedily, so it doesn’t end up empty) in group3.  In the replacement, if group1 (lowercase) matched, then uppercase it; if group2 (uppercase) matched, then lowercase it; no matter what, lowercase everything in group3.</p>
<p dir="auto">with the example text</p>
<pre><code class="language-z">john:abc232
smith:Snlf1999
john:aBC232
smith:SNLF1999
</code></pre>
<p dir="auto">it will become</p>
<pre><code class="language-z">john:Abc232
smith:snlf1999
john:Abc232
smith:snlf1999
</code></pre>
<p dir="auto">I am surprised <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> hadn’t chimed in already, since he was around a few minutes ago.  I am sure at some point, he will offer a more elegent, well-explained version. :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/54468</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/54468</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sun, 31 May 2020 18:00:11 GMT</pubDate></item></channel></rss>