<?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[Why is it that some regex match is not replaced one by one?]]></title><description><![CDATA[<p dir="auto">I am using notepad++ for text editing.</p>
<p dir="auto">sample text : hello,this is a test.are you ready?</p>
<p dir="auto">search for : (?&lt;=[a-z,.?! ])([,.?!])(?=[a-z])</p>
<p dir="auto">replace with : \1</p>
<p dir="auto">replace result : hello, this is a test. are you ready?</p>
<p dir="auto">It works as intended, only if I replace them all, but if I click on replace button, nothing happens. It navigates to the next match as if I click on find.</p>
<p dir="auto">refer to this screenshot  [<a href="https://i.stack.imgur.com/4CiPY.png" rel="nofollow ugc">https://i.stack.imgur.com/4CiPY.png</a>]</p>
<p dir="auto">Is it a bug and what’s the solution I should try?</p>
<p dir="auto">Thank you!</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/19891/why-is-it-that-some-regex-match-is-not-replaced-one-by-one</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 07:37:49 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/19891.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 21 Aug 2020 22:08:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Why is it that some regex match is not replaced one by one? on Sat, 25 Dec 2021 18:05:23 GMT]]></title><description><![CDATA[<p dir="auto">@[<em>username redacted</em>] said in <a href="/post/57017">Why is it that some regex match is not replaced one by one?</a>:</p>
<blockquote>
<p dir="auto">I wonder if I could open the document and remember the last scroll position so next time I reopen it, it straight nagivgates to where it was.</p>
</blockquote>
<p dir="auto">You may find <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/3671" rel="nofollow ugc">THIS</a> to be of interest on that topic.  There’s a Pythonscript there that supposedly solves this “problem”.  I haven’t tried the script out yet, so I can’t fully endorse it.  It’s on my evergrowing “TODO” list. :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/57033</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57033</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 25 Dec 2021 18:05:23 GMT</pubDate></item><item><title><![CDATA[Reply to Why is it that some regex match is not replaced one by one? on Sat, 25 Dec 2021 18:05:15 GMT]]></title><description><![CDATA[<p dir="auto">@[<em>username redacted</em>]</p>
<blockquote>
<p dir="auto">remember the last scroll position</p>
</blockquote>
<p dir="auto">if you close/exit <em>Notepad++</em> and reload the application, it <em>does</em> remember the scroll position for the active session.  But no, once you close the document, it loses that scroll information.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/57018</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57018</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 25 Dec 2021 18:05:15 GMT</pubDate></item><item><title><![CDATA[Reply to Why is it that some regex match is not replaced one by one? on Fri, 21 Aug 2020 23:12:02 GMT]]></title><description><![CDATA[<p dir="auto">can I ask one more for troubleshooting?<br />
I wonder if I could open the document and remember the last scroll position so next time I reopen it, it straight nagivgates to where it was.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/57017</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57017</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 21 Aug 2020 23:12:02 GMT</pubDate></item><item><title><![CDATA[Reply to Why is it that some regex match is not replaced one by one? on Fri, 21 Aug 2020 23:03:59 GMT]]></title><description><![CDATA[<p dir="auto">thanks for the reply. maybe this is the alternative I can think of.</p>
<p dir="auto">([a-z,.?! ][,.?!])(?=[a-z])</p>
<p dir="auto">it’s not perfect, but it does the job anyway :)<br />
only downside is it matches preceding characters as well, so it looks less charming.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/57015</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57015</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 21 Aug 2020 23:03:59 GMT</pubDate></item><item><title><![CDATA[Reply to Why is it that some regex match is not replaced one by one? on Sat, 25 Dec 2021 18:05:05 GMT]]></title><description><![CDATA[<p dir="auto">@[<em>username redacted</em>] ,</p>
<p dir="auto">Any regex that uses <code>\K</code> match-resets or <code>(?&lt;=...)</code> / <code>(?&lt;!...)</code> lookbehinds require using <strong>replace all</strong> rather than single <strong>replace</strong> actions.  That’s the way it was designed, to avoid certain …confusions… that would arise with reset- and lookbehind- replacements run one-at-a-time.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/57014</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57014</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 25 Dec 2021 18:05:05 GMT</pubDate></item></channel></rss>