<?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[(&#x5C;W)&#x27;(&#x5C;w) Regex replace failure]]></title><description><![CDATA[<p dir="auto">I’m aware that there are other ways to achieve this, and that’s indeed what I ended up doing, but I’m still hoping to understand why my initial method did not work…</p>
<p dir="auto">In ANSI text, I sought to replace selected instances of the straight single quote (<code>'</code>) that were preceded by any non-word character and followed by any word character, with the right/closing curly single quote (<code>’</code>), using FIND WHAT string <code>(\W)'(\w)</code> and REPLACE WITH string <code>\1’\2</code>. Some example text I tried it on:</p>
<pre><code>this
'Cos I am
that

this
'Round and 'round
that
</code></pre>
<p dir="auto">My FIND WHAT string successfully matched everything it was intended to, shown as marked here:</p>
<p dir="auto"><img src="/assets/uploads/files/1785950382573-2026-08-05-12-36-09-maze-marked-regex-match.png" alt="2026-08-05 12;36;09 - MAZE - Marked Regex Match.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">However, my REPLACE WITH string only replaced the third instance (<code> 'r</code>) and reported no error messages for the first two before jumping to the next instance when I clicked on REPLACE. Anybody? <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a>?</p>
<p dir="auto">[Note to <a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: Coises">@<bdi>Coises</bdi></a>: I also tried this with Search++ , which also failed to work as expected — though in a different way than NPP’s native find/replace feature — which I will report separately.]</p>
<p dir="auto">Debug:</p>
<pre><code>Notepad++ v8.9.7   (32-bit)
Build time: Jul 14 2026 - 01:11:31
Scintilla/Lexilla included: 5.6.4/5.5.1
Boost Regex included: 1_90
pugixml included: 1.16
nlohmann JSON included: 3.12.0
Path: C:\Program Files (x86)\Notepad++\notepad++.exe
Command Line: 
Admin mode: OFF
Local Conf mode: OFF
Cloud Config: OFF
WinGUp: present
disableNppAutoUpdate.xml: absent
Periodic Backup: ON
Placeholders: OFF
Scintilla Rendering Mode: SC_TECHNOLOGY_DIRECTWRITE (1)
Multi-instance Mode: monoInst
asNotepad: OFF
File Status Auto-Detection: cdEnabledNew (for current file/tab only)
Dark Mode: OFF
Display Info:
    primary monitor: 1920x1080, scaling 100%
    visible monitors count: 1
    installed Display Class adapters: 
        0000: Description - Intel(R) HD Graphics 620
        0000: DriverVersion - 31.0.101.2140
        0001: Description - NVIDIA GeForce 940MX
        0001: DriverVersion - 30.0.15.1169
OS Name: Windows 10 Enterprise (64-bit)
OS Version: 22H2
OS Build: 19045.7548
Current ANSI codepage: 1252
Plugins: 
    BetterMultiSelection (1.5)
    ColumnsPlusPlus (1.3.1)
    ColumnTools (1.4.5.1)
    ComparePlus (3)
    DSpellCheck (1.5)
    ExtSettings (1.3.1)
    HTMLTag_unicode (1.6)
    mimeTools (3.1)
    MultiClipboard (2.1)
    MultiReplace (6.0.0.36)
    NppCalc (1.5)
    NppConverter (4.7)
    NppExport (0.4)
    NPPJSONViewer (2.2)
    NppTextFX (2.0.3)
    NppXmlTreeviewPlugin (2)
    PreviewHTML (1.4.5)
    PythonScript (2.1)
    RegexTrainer (1.2)
    Search++ (0.6.3.1)
    SessionMgr (1.4.4)
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/topic/27621/w-w-regex-replace-failure</link><generator>RSS for Node</generator><lastBuildDate>Wed, 05 Aug 2026 19:40:59 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27621.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 05 Aug 2026 17:24:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to (&#x5C;W)&#x27;(&#x5C;w) Regex replace failure on Wed, 05 Aug 2026 18:40:59 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: Coises">@<bdi>Coises</bdi></a> <a href="/post/106019">said</a>:</p>
<p dir="auto">Notepad++ won’t let the selection that results from a search split a CRLF line ending.</p>
</blockquote>
<p dir="auto">Noted, thanks.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/106020</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/106020</guid><dc:creator><![CDATA[M Andre Z Eckenrode]]></dc:creator><pubDate>Wed, 05 Aug 2026 18:40:59 GMT</pubDate></item><item><title><![CDATA[Reply to (&#x5C;W)&#x27;(&#x5C;w) Regex replace failure on Wed, 05 Aug 2026 18:01:08 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/m-andre-z-eckenrode" aria-label="Profile: M-Andre-Z-Eckenrode">@<bdi>M-Andre-Z-Eckenrode</bdi></a> <a href="/post/106015">said</a>:</p>
<p dir="auto">I’m still hoping to understand why my initial method did not work…</p>
</blockquote>
<p dir="auto">Notice what happens if you change your line endings to Unix (<strong>Edit</strong> | <strong>EOL conversion</strong> | <strong>Unix</strong>). With <strong>View</strong> | <strong>Show Symbol</strong> | <strong>Show End of Line</strong> enabled, watch carefully what gets highlighted as you click <strong>Replace</strong> repeatedly. Now undo to restore your straight quotes and return to Windows line endings, move the caret back to the beginning, and compare what happens when you click <strong>Replace</strong> repeatedly.</p>
<p dir="auto">Notepad++ won’t let the selection that results from a search split a CRLF line ending. As you can see, it moves the start of the selection from the actual location of the match to <em>after</em> the line ending.</p>
<p dir="auto">When you click <strong>Replace</strong>, Notepad++ decides whether to replace or find the next occurrence by first checking whether <strong>Find what</strong> matches the current selection. If it does, Notepad++ does a replace; otherwise, it does a find.</p>
<p dir="auto">The selection doesn’t match, because there is no character before the curly single quote.</p>
<p dir="auto">That’s the why. Whether it’s a bug is… I suppose a matter of opinion.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/106019</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/106019</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Wed, 05 Aug 2026 18:01:08 GMT</pubDate></item></channel></rss>