<?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[Find&amp;Replace pairs of capitalised words]]></title><description><![CDATA[<p dir="auto">Hi everyone,</p>
<p dir="auto">I have tried finding what I need in the forum but I am missing part of the regex syntax. Hope you guys can help!</p>
<p dir="auto">I need to:<br />
Find: pairs of capitalised words separated by a space<br />
Replace: space for equal sign<br />
For example:<br />
Adam Sandler --&gt; Adam=Sandler<br />
New Zealand --&gt; New=Zealand</p>
<p dir="auto">With Regular expression checked, I have tried:</p>
<pre><code>[A-Z].*[A-Z]
</code></pre>
<p dir="auto">But that also brings up instances like:</p>
<pre><code>Christmas we're going to Lapland
</code></pre>
<p dir="auto">I would need something to limit the number of words that can fit in between [A-Z]s. I tried the following to limit the number of characters to 4 (as an example):</p>
<pre><code>[A-Z] .*\w{4} [A-Z]
</code></pre>
<p dir="auto">But it didn’t work either.</p>
<p dir="auto">I just need to find pairs of capitalised words but I am struggling.</p>
<p dir="auto">It would also be great if you could suggest a code that won’t spit out results of ‘I’ as in the pronoun. For example:</p>
<pre><code>Overwatch I'm in
</code></pre>
<p dir="auto">Thanks a lot in advance!</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/19018/find-replace-pairs-of-capitalised-words</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 08:06:54 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/19018.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 06 Mar 2020 18:48:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Find&amp;Replace pairs of capitalised words on Sat, 07 Mar 2020 17:29:15 GMT]]></title><description><![CDATA[<p dir="auto">Thanks to both, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> and <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a> :) :) :)</p>
<p dir="auto">Both codes worked like a charm.</p>
<p dir="auto">For anyone interested in these codes, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@Ekopalypse</a> 's code finds every space-separated pair of words starting with a capital letter , and <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/195">@guy038</a> 's code finds every space between words starting with a capital letter. Both were good for what I needed to do!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/51220</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/51220</guid><dc:creator><![CDATA[Joaquin Bueno]]></dc:creator><pubDate>Sat, 07 Mar 2020 17:29:15 GMT</pubDate></item><item><title><![CDATA[Reply to Find&amp;Replace pairs of capitalised words on Fri, 06 Mar 2020 21:51:25 GMT]]></title><description><![CDATA[<p dir="auto">Hello, @Joaquin Bueno, <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@ekopalypse</a> and <strong>All</strong>,</p>
<p dir="auto">An <strong>alternate</strong> solution to <a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14479">@ekopalypse</a>’s one could be :</p>
<p dir="auto">SEARCH <strong><code>(?-i)\u\w+\K\h+(?=\u\w*+(?!'))</code></strong></p>
<p dir="auto">REPLACE <strong><code>=</code></strong></p>
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">First the <strong><code>(?-i)</code></strong> <strong>in-line</strong> modifier tells the regex engine to run the search in a <strong>NON-insensitive</strong> way</p>
</li>
<li>
<p dir="auto">Then the part <strong><code>\u\w+</code></strong> looks a word with a first <strong>upper-case</strong> letter followed with a <strong>non-null</strong> range of <strong>word</strong> characters</p>
</li>
<li>
<p dir="auto">And the part <strong><code>\K</code></strong> <strong>resets</strong> the regex engine position of search and <strong>cancels</strong> the match, so far</p>
</li>
<li>
<p dir="auto">Therefore, it searches, now, for a <strong>non-null</strong> range of <strong>horizontal blank</strong> characters <strong><code>\h+</code></strong> ( <strong>Tabs</strong> and/or <strong>Spaces</strong> ) …</p>
</li>
<li>
<p dir="auto">But <em>ONLY IF</em>  a <strong>double</strong> condition is <strong>true</strong>, due to the <strong>nested</strong> look-aheads structure :</p>
<ul>
<li>
<p dir="auto">It must be <strong>followed</strong> with an <strong>other</strong> word, of at least <strong><code>1</code></strong> <strong>upper-case</strong> letter, with <strong>possible</strong> subsequent <strong>word</strong> character(s), which…</p>
</li>
<li>
<p dir="auto">Must <strong>not</strong> be followed with a <strong>single</strong> quote <strong><code>'</code></strong>. Thus, it <strong>eliminates</strong> cases of <strong>contractions</strong> such as “<em>I’m, You’re, We’d,…</em>”</p>
</li>
</ul>
</li>
<li>
<p dir="auto">In order that the <strong>negative</strong> look-ahead <strong><code>(?!')</code></strong> works as <strong>expected</strong>, we need to place the <strong><code>+</code></strong> <strong>regex</strong> symbol, after the part <strong><code>\w*</code></strong>, to <strong>set</strong> this group of <strong>word</strong> char(s) as an <strong>atomic</strong> group and, therefore, prevent the regex engine from <strong>backtracking</strong> inside it !</p>
</li>
<li>
<p dir="auto">Note, also, that <strong>all</strong> text matched by the regexes, in <strong>look-arounds</strong>, are <strong>never</strong> part of the <strong>overall</strong> match</p>
</li>
<li>
<p dir="auto">In <strong>replacement</strong>, the <strong>blank</strong> character(s) matched is/are replaced with one <strong>equal</strong> sign <strong><code>=</code></strong></p>
</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/51209</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/51209</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Fri, 06 Mar 2020 21:51:25 GMT</pubDate></item><item><title><![CDATA[Reply to Find&amp;Replace pairs of capitalised words on Fri, 06 Mar 2020 19:13:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/17927">@Joaquin-Bueno</a></p>
<p dir="auto">I assume this might work</p>
<p dir="auto">find what:<code>([A-Z]\w+)(\h+)([A-Z]\w+)</code><br />
replace with:<code>\1=\3</code><br />
make sure <strong>match case</strong> has been checked</p>
]]></description><link>https://community.notepad-plus-plus.org/post/51191</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/51191</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Fri, 06 Mar 2020 19:13:10 GMT</pubDate></item></channel></rss>