<?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[How to change apostrophe to letter g as a whole word]]></title><description><![CDATA[<p dir="auto">Is it possible to change word ending “in’” to “ing” for example “something” and “breaking”? Somethin’ to something.</p>
<p dir="auto">I used Gemini and they gave me</p>
<pre><code>\b(in )'\z
\b(in')'\z
\b(in)\z
\b(in)(?&lt;!g)\z
</code></pre>
<p dir="auto">But all didn’t work.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/25658/how-to-change-apostrophe-to-letter-g-as-a-whole-word</link><generator>RSS for Node</generator><lastBuildDate>Tue, 13 Oct 2026 13:33:50 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/25658.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 06 Apr 2024 10:03:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to change apostrophe to letter g as a whole word on Sat, 06 Apr 2024 16:13:49 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> Thank you, it works</p>
]]></description><link>https://community.notepad-plus-plus.org/post/94084</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/94084</guid><dc:creator><![CDATA[Mohamed Mohamed]]></dc:creator><pubDate>Sat, 06 Apr 2024 16:13:49 GMT</pubDate></item><item><title><![CDATA[Reply to How to change apostrophe to letter g as a whole word on Sat, 06 Apr 2024 16:05:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mohamed-mohamed" aria-label="Profile: Mohamed-Mohamed">@<bdi>Mohamed-Mohamed</bdi></a> ,</p>
<blockquote>
<p dir="auto">But all didn’t work.</p>
</blockquote>
<p dir="auto">Of course not.  None of those correctly described the circumstances you wanted.</p>
<p dir="auto">Looking at <a href="https://npp-user-manual.org/docs/searching/#anchors" rel="nofollow ugc">https://npp-user-manual.org/docs/searching/#anchors</a> for the definitions of the sequences at the beginning and end of all those attempts ⇒ <img src="/assets/uploads/files/1712418577985-a0a95fae-4d8b-4aea-adfd-f4f05f27c03b-image.png" alt="a0a95fae-4d8b-4aea-adfd-f4f05f27c03b-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">First, the <code>\b</code> means “word boundary”, and <code>somethin'</code> and <code>breakin'</code> do not have a “word boundary” between the <code>h</code> or <code>k</code> and the <code>in</code>; in fact, if anything, you want a “not a word boundary” before the <code>in</code>, so it would be <code>\B(in)</code> instead.</p>
<p dir="auto">Second, <code>\z</code> matches the end of the file, so unless the <code>in'</code> to <code>ing</code> is at the very end of your file, there is no way any of those will work.</p>
<p dir="auto">Ignoring the incorrect <code>\b</code> and <code>\z</code> placement in all those expressions:</p>
<ul>
<li><code>(in )'</code> ⇒ requires a space before the apostrophe, which I doubt you want</li>
<li><code>(in')'</code> ⇒ requires two apostrophes (one that you want to keep and one you want to throw away), which is not what you claimed you wanted</li>
<li><code>(in)</code> ⇒ will match <code>in</code> anywhere, rather than being restricted to the end of a word</li>
<li><code>(in)(?&lt;!g)</code> ⇒ not quite what you want, because that would match the <code>in</code> in <code>brink</code>
<ul>
<li>and why use a lookbehind at the end of a sequence?  It doesn’t do what you think.  It says “match <code>i</code> then <code>n</code>, then in the next character position, make sure that a <code>g</code> does not come before”.  So in the word <code>something</code>, you would match the <code>i</code> and then the <code>n</code>, then the cursor is between <code>n</code> and <code>g</code> and it looks backwards and says “the character before (that is, the <code>n</code> you just matched) is not a <code>g</code>, so I am fine”.  <img src="/assets/uploads/files/1712419054291-153c7955-2c0c-42d2-bcaf-48525e1eb16d-image.png" alt="153c7955-2c0c-42d2-bcaf-48525e1eb16d-image.png" class=" img-fluid img-markdown" /></li>
<li>I think what you intended was a negative lookahead instead: <code>(?!g)</code> <img src="/assets/uploads/files/1712419069897-b24898f6-fbe6-45cd-8d96-ac1cbc80845e-image.png" alt="b24898f6-fbe6-45cd-8d96-ac1cbc80845e-image.png" class=" img-fluid img-markdown" /></li>
<li>but if you use the apostrophe, which is required for what you were describing anyway, you don’t need the negative lookahead for the <code>g</code> at all, because matching an apostrophe will obviously not match a <code>g</code> in that same character location.</li>
</ul>
</li>
</ul>
<p dir="auto">Closer to what you want is <code>\B(in)'</code> … which will work on all the examples above… but that has a problem: it will match <code>Karin's</code>, which you probably don’t want.  So then add a negative lookahead for a word character – so it will allow punctuation or space or newline or EOF after the apostrophe, but not alphanumeric.</p>
<p dir="auto">Final result: <code>\B(in)'(?!\w)</code></p>
<p dir="auto">-—</p>
<h3>Useful References</h3>
<ul>
<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/94082</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/94082</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 06 Apr 2024 16:05:30 GMT</pubDate></item></channel></rss>