<?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[Selecting things of a certain type]]></title><description><![CDATA[<p dir="auto">Hi, I was wondering whether I could select things that the application sees as separate things. I’m very new to Notepad++. I was editing a minecraft language file and I want an easy way to select all the strings so I can change them to uppercase all at once. Please help. Thanks!<img src="/assets/uploads/files/1686155720570-innit-bruv.png" alt="innit bruv.png" class=" img-fluid img-markdown" /><br />
Here’s the file I was working on:</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/24546/selecting-things-of-a-certain-type</link><generator>RSS for Node</generator><lastBuildDate>Fri, 11 Sep 2026 13:00:52 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/24546.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 07 Jun 2023 16:36:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Selecting things of a certain type on Wed, 07 Jun 2023 23:22:27 GMT]]></title><description><![CDATA[<p dir="auto">Find/replace <code>(?-si)(?::\s*"|(?&lt;!%)%\d*[dsf]|(?!\A)\G)\K((?:(?!(?:(?&lt;!%)%\d*[dsf]|")).)*)</code> with <code>\U\1\E</code>.</p>
<p dir="auto">Note that this won’t actually convert <em>all</em> your text to upper-case, because some of it (<a href="https://docs.python.org/3/library/stdtypes.html#old-string-formatting" rel="nofollow ugc">the <code>%s</code> format specifiers</a>) will probably cause bugs downstream if it is capitalized. This regex is very careful to avoid capitalizing format specifiers, which is a lot of why it looks (and is, TBH) so hairy.</p>
<p dir="auto">My regex doesn’t handle all the possible syntax surrounding format specifiers, because I don’t have 3 hours to spend enumerating and debugging each weird edge case, but it should be fine assuming that all the strings are values in dictionaries. The find-regex becomes the absolutely abhorrent <code>(?-si)(?:"|(?&lt;!%)%\d*[dsf]|(?!\A)\G)\K(?=[^"]*"\s*[,\]\}])((?:(?!(?:(?&lt;!%)%\d*[dsf]|")).)*)</code> in the case where the strings can be strings in arrays or values in dictionaries.</p>
<p dir="auto">Test text:</p>
<pre><code class="language-json">{
    "a.b": "caps %02d %5s %d %03fnocaps %%02dcaps",
    "b.c.d": "%%caps %3sap %s cap"
}
</code></pre>
<p dir="auto">Expected output:</p>
<pre><code class="language-json">{
    "a.b": "CAPS %02d %5s %d %03fNOCAPS %%02DCAPS",
    "B.C.D": "%%CAPS %3sAP %s CAP"
}
</code></pre>
<p dir="auto">If you’re absolutely sure you want to capitalize <em>everything that’s not a key</em>, just use this much simpler regex-replace: <code>"\s*:\s*"[^"]*"</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/86912</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/86912</guid><dc:creator><![CDATA[Mark Olson]]></dc:creator><pubDate>Wed, 07 Jun 2023 23:22:27 GMT</pubDate></item><item><title><![CDATA[Reply to Selecting things of a certain type on Wed, 07 Jun 2023 18:02:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jacksonspike" aria-label="Profile: JacksonSpike">@<bdi>JacksonSpike</bdi></a> ,</p>
<p dir="auto">Your use of the phrases “certain type” or “separate things” is rather ambiguous.</p>
<p dir="auto">If you have a selection in Notepad++, then <strong><a href="https://npp-user-manual.org/docs/editing/#edit-menu" rel="nofollow ugc">Edit</a> &gt; Convert Case To… &gt; UPPERCASE</strong> (or the <code>Ctrl+Shift+U</code> default keyboard shortcut) will convert the active selection to all-caps.</p>
<p dir="auto">For manually selecting multiple pieces of text at the same time, <strong><a href="https://npp-user-manual.org/docs/preferences/#editing" rel="nofollow ugc">Settings &gt; Preferences &gt; Editing</a> &gt; ☑ Enable Multi-Editing</strong> will allow you to use Ctrl+Click (and drag) to select multiple pieces of text at the same time.</p>
<p dir="auto">Or, if you have a search expression (in <a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">Regular Expression mode</a>) that can find all the text that you want to uppercase, if your <strong>Find What</strong> already finds the right text, then <strong>Replace With</strong> can be set to <code>\U$0</code> to replace the found text with the <a href="https://npp-user-manual.org/docs/searching/#substitutions" rel="nofollow ugc">uppercase version</a> of the text.</p>
<p dir="auto">But without more detail than you gave, I can only give this hints.</p>
<p dir="auto">-—</p>
<p dir="auto"><em>(The links above were taken from various sections of the Online User Manual)</em></p>
<h3>Useful References</h3>
<ul>
<li><a href="https://community.notepad-plus-plus.org/topic/21965/please-read-before-posting">Please Read Before Posting</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/22022/template-for-search-replace-questions">Template for Search/Replace Questions</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/21925/faq-desk-formatting-forum-posts">Formatting Forum Posts</a></li>
<li><a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">Notepad++ Online User Manual: Searching/Regex</a></li>
<li><a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regular-expressions-regex-documentation">FAQ: Where to find other regular expressions (regex) documentation</a></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/86899</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/86899</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Wed, 07 Jun 2023 18:02:29 GMT</pubDate></item></channel></rss>