<?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 won't this PCRE regular expression work in Notepad++ when it works on regex101?]]></title><description><![CDATA[<p dir="auto">I have a PCRE Regular Expression that observes common restrictions and finds and selects a specified phrase at the beginning of sentences, <em>only if</em> it is preceded by a sentence that also contains the phrase. The first sentence’s phrase is <strong>not</strong> selected.</p>
<p dir="auto">Example:</p>
<pre><code>Phrase A: Words
Phrase A: Words
Phrase A: Words
Phrase B: Words
Phrase B: Words
Phrase A: Words
Phrase A: Words
Phrase B: Words
Phrase A: Words
Phrase A: Words
</code></pre>
<p dir="auto">So in the above sequence, the user specifies <code>Phrase A: </code> in the expression, and it then selects <em>only</em> <code>Phrase A: </code> in lines 2, 3, 7, and 10:</p>
<pre><code>Phrase A: Words
[Phrase A: ] Words
[Phrase A: ] Words
Phrase B: Words
Phrase B: Words
Phrase A: Words
[Phrase A: ] Words
Phrase B: Words
Phrase A: Words
[Phrase A: ] Words
</code></pre>
<p dir="auto">The expression is:<br />
<code>/(?&lt;=Phrase A: ).*[\r\n]+\KPhrase A: /gm</code></p>
<p dir="auto">It doesn’t work with numbers, and only works if the phrase is at the beginning of a line:<br />
<a href="https://regex101.com/r/X9xGdf/1" rel="nofollow ugc">https://regex101.com/r/X9xGdf/1</a></p>
<p dir="auto">However, it doesn’t work in Notepad++. I’ve tried both Notepad++'s native tools and also the MultiReplace plugin, neither work.</p>
<p dir="auto">Is this a bug, something I’m doing wrong, or just something that’s not possible in Notepad++? (For what it’s worth, I also tried UltraEdit; it didn’t work there either.)</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/26693/why-won-t-this-pcre-regular-expression-work-in-notepad-when-it-works-on-regex101</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 06:36:12 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/26693.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 12 Mar 2025 04:32:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Why won't this PCRE regular expression work in Notepad++ when it works on regex101? on Sat, 15 Mar 2025 07:50:30 GMT]]></title><description><![CDATA[<p dir="auto">Hi <strong>All</strong>,</p>
<p dir="auto">See my <strong>important</strong> and <em>final</em>  comment about my own <strong>issue</strong> :</p>
<p dir="auto"><a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16279#issuecomment-2726313083" rel="nofollow ugc">https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16279#issuecomment-2726313083</a></p>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/100355</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/100355</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 15 Mar 2025 07:50:30 GMT</pubDate></item><item><title><![CDATA[Reply to Why won't this PCRE regular expression work in Notepad++ when it works on regex101? on Sat, 15 Mar 2025 04:25:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lycan-thrope" aria-label="Profile: Lycan-Thrope">@<bdi>Lycan-Thrope</bdi></a> said in <a href="/post/100353">Why won't this PCRE regular expression work in Notepad++ when it works on regex101?</a>:</p>
<blockquote>
<p dir="auto">I kind of agree with <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> and <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> how he maybe should have proceeded, but obviously per <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> , <a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: Coises">@<bdi>Coises</bdi></a> solution was a better option for him.</p>
</blockquote>
<p dir="auto">It’s kind of a weird regular expression. Had I been trying to solve this problem from scratch, I probably would have done something like <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> suggested.</p>
<p dir="auto">The only reason I brought up Columns++ was because the original poster succeeded in getting the expression to match exactly what he wanted, but replacement with an empty string didn’t work. He wanted a way to select all the matches so he could delete them, and that is something Columns++ search offers that Notepad++ search does not.</p>
<p dir="auto">The thing that makes this tricky is that regular expression replacements occur after each corresponding match; it doesn’t first match everything, then do the replacements. And for this problem, some matches (third and subsequent lines beginning with “Phrase A: ”) fail once the previously matched text has been replaced.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a>’s suggestion is the normal way of solving this sort of problem. You “mark” each match by adding some character that you know doesn’t occur in the file, then you use those marks to make the changes you need in a second step. I don’t think there is, in general, a way to do it in a single step (though of course in any specific case there might be a “trick”).</p>
<p dir="auto">Columns++ offers an alternative approach by allowing multi-selection of all the matches without changing the file. In this case, just pressing delete was enough for the second step; in a more complex case, Columns++ allows you to reset the search region to match the multi-selection, so you could then search, or search and replace, within the previous matches. I think it’s powerful, though completely non-standard. You could always accomplish the same thing with the “add a character that isn’t used in the file” technique, though.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/100354</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/100354</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Sat, 15 Mar 2025 04:25:19 GMT</pubDate></item><item><title><![CDATA[Reply to Why won't this PCRE regular expression work in Notepad++ when it works on regex101? on Sat, 15 Mar 2025 03:50:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry-r" aria-label="Profile: Terry-R">@<bdi>Terry-R</bdi></a> said in <a href="/post/100312">Why won't this PCRE regular expression work in Notepad++ when it works on regex101?</a>:</p>
<blockquote>
<p dir="auto">Actually I think you missed the OP’s need. They said:</p>
</blockquote>
<p dir="auto">I did say, I may have misunderstood what he was testing for. I thought the first line being highlighted by a background color indicated it was chosen, so yeah that’s my bad…and I did say I’m no regex expert. :-)</p>
<p dir="auto">I kind of agree with <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> and <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> how he maybe should have proceeded, but obviously per <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> , <a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: Coises">@<bdi>Coises</bdi></a> solution was a better option for him. I don’t know, I’m not currently working in his plugin, so wouldn’t have known if that would work.  I’m still trying to work out some kind of solution, but seem not to be able to treat the regex like a programming logic, or don’t know the proper syntax of the Boost regex to try and make something work the way we want.<br />
Since most of you accomplished guys aren’t seemingly able to solve it, I don’t hold out hope for myself, either, but at least it’s making me read more of the documentation and found some new things to look at and learn, like \G (little L). Just learning and will be wrong. :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/100353</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/100353</guid><dc:creator><![CDATA[Lycan Thrope]]></dc:creator><pubDate>Sat, 15 Mar 2025 03:50:00 GMT</pubDate></item><item><title><![CDATA[Reply to Why won't this PCRE regular expression work in Notepad++ when it works on regex101? on Fri, 14 Mar 2025 13:39:26 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <strong>All</strong>,</p>
<p dir="auto">As intended, here is my <strong>issue</strong> , on <strong>GitHub</strong> :</p>
<p dir="auto"><a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16279" rel="nofollow ugc">https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16279</a></p>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/100337</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/100337</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Fri, 14 Mar 2025 13:39:26 GMT</pubDate></item><item><title><![CDATA[Reply to Why won't this PCRE regular expression work in Notepad++ when it works on regex101? on Thu, 13 Mar 2025 12:21:11 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/blohojo" aria-label="Profile: blohojo">@<bdi>blohojo</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/terry-r" aria-label="Profile: terry-r">@<bdi>terry-r</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: coises">@<bdi>coises</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/lycan-thrope" aria-label="Profile: lycan-thrope">@<bdi>lycan-thrope</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Indeed, this <strong>tricky</strong> replacement <strong>cannot</strong> be correctly done because, as soon as the string <strong><code>Phrase A: </code></strong> had been <strong>deleted</strong>, the regex conditions do <strong>not</strong> exist anymore for a <strong>possible</strong> match of the <strong>next</strong> line !</p>
<p dir="auto">Thus, instead of trying to <em>DELETE</em> anything, we’ll try, <strong>first</strong>, to <em>ADD</em> something to the <strong>matched</strong> lines !</p>
<hr />
<p dir="auto">So, from your <em>INPUT</em> text, below :</p>
<pre><code class="language-diff">Phrase A: Words
Phrase A: Words
Phrase A: Words
Phrase B: Words
Phrase B: Words
Phrase A: Words
Phrase A: Words
Phrase B: Words
Phrase A: Words
Phrase A: Words
</code></pre>
<p dir="auto">the following <strong>regex</strong> S/R will add, for example, the <strong><code>¶</code></strong> symbol at the <strong>beginning</strong> of <strong>any</strong> line that need to be <strong>matched</strong> :</p>
<p dir="auto">FIND <strong><code>(?-s)(?&lt;=Phrase A: ).*\R\K(?=Phrase A: )</code></strong></p>
<p dir="auto">REPLACE <strong><code>¶</code></strong></p>
<p dir="auto">And, after a <strong>click</strong> on the <strong><code>Replace All</code></strong> button, would produce this <strong>temporary</strong> <em>OUTPUT</em> :</p>
<pre><code class="language-diff">Phrase A: Words
¶Phrase A: Words
¶Phrase A: Words
Phrase B: Words
Phrase B: Words
Phrase A: Words
¶Phrase A: Words
Phrase B: Words
Phrase A: Words
¶Phrase A: Words
</code></pre>
<p dir="auto">Then, the <strong>trivial</strong> S/R, below, would delete <strong>all</strong> the lines <strong>beginning</strong> with the string <strong><code>¶Phrase A:\x20</code></strong> :</p>
<p dir="auto">FIND <strong><code>(?-i)^¶Phrase A:\x20</code></strong></p>
<p dir="auto">REPLACE <strong><code>Leave EMPTY</code></strong></p>
<p dir="auto">And you get your <strong>expected</strong> <em>OUTPUT</em> text :</p>
<pre><code class="language-diff">Phrase A: Words
Words
Words
Phrase B: Words
Phrase B: Words
Phrase A: Words
Words
Phrase B: Words
Phrase A: Words
Words
</code></pre>
<p dir="auto">However, I admit that the <a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: coises">@<bdi>coises</bdi></a>’s solution, with the <strong><code>Plugins &gt; Columns++ &gt; Search...</code></strong> option and using the <strong><code>(?-s)(?&lt;=Phrase A: ).*\R\KPhrase A:\x20</code></strong> regex, is <strong>more</strong> simple and obvious !</p>
<hr />
<p dir="auto">Note that, if in the <strong>first</strong> S/R, I had written <strong><code>(?-s)(?&lt;=^Phrase A: ).*\R\K(?=Phrase A: )</code></strong>, the <strong>second</strong> match in line <strong><code>3</code></strong> would <strong>not</strong> have been found because the regex would have <strong>expected</strong> that the word <strong><code>Phrase</code></strong> <em>BEGINS</em> the line !</p>
<hr />
<p dir="auto"><em>IMPORTANT</em> note :</p>
<p dir="auto">If a <strong><code>MARK</code></strong> operation <strong>only</strong> concerns <strong>zero-length</strong> strings, like my <strong>first</strong> S/R, it just returns the message <strong><code>Mark: 0 matches in entire file</code></strong> or the message <strong><code>Mark: 0 matches from caret to end of file</code></strong>, instead of the message <strong><code>Mark: # matches...</code></strong>, with <strong><code># &gt; 0</code></strong>. However, as shown above, it <strong>did</strong> realize the needed <strong>replacements</strong> ! So, I think it’s a Notepad++ <strong>bug</strong> and I should create an <strong>issue</strong> about it !</p>
<p dir="auto">Of course, the fact that <strong>no</strong> highlighting occurs is quite <strong>logical</strong> because one <strong>cannot</strong> highlight <strong>zero-length</strong> strings !! And I suppose this leads to the <strong><code>0 matches</code></strong> result :-((</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
<p dir="auto"><strong>P.S</strong>. :</p>
<p dir="auto">If I use my <strong>first</strong> search regex <strong><code>(?-s)(?&lt;=Phrase A: ).*\R\K(?=Phrase A: )</code></strong>, with the <strong><code>Columns++</code></strong> plugin, and click on the <strong><code>Select All</code></strong> button, it does find <strong><code>4</code></strong> <strong>zero-length</strong> matches !</p>
]]></description><link>https://community.notepad-plus-plus.org/post/100316</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/100316</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 13 Mar 2025 12:21:11 GMT</pubDate></item><item><title><![CDATA[Reply to Why won't this PCRE regular expression work in Notepad++ when it works on regex101? on Thu, 13 Mar 2025 00:10:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: Coises">@<bdi>Coises</bdi></a></p>
<p dir="auto">It seems like the suggestion of using a plugin to solve the OP’s problem is a bit “much” when the problem can be solved with Notepad++ itself/alone.</p>
<p dir="auto">However, as OP did ask for a means to “select” search matches, and Notepad++ can’t do that, suggesting the plugin makes some sense.  But, for any future readers of this with a similar need, replacing search matches with nothing effectively deletes them – you don’t need a means to “select” them so that you can then hit the <em>Delete</em> key to remove them.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/100314</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/100314</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 13 Mar 2025 00:10:01 GMT</pubDate></item><item><title><![CDATA[Reply to Why won't this PCRE regular expression work in Notepad++ when it works on regex101? on Wed, 12 Mar 2025 23:56:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lycan-thrope" aria-label="Profile: Lycan-Thrope">@<bdi>Lycan-Thrope</bdi></a> said in <a href="/post/100310">Why won't this PCRE regular expression work in Notepad++ when it works on regex101?</a>:</p>
<blockquote>
<p dir="auto">and it seems to have done exactly what your first example shows you desired.</p>
</blockquote>
<p dir="auto">Actually I think you missed the OP’s need. They said:<br />
<em><strong>and finds and selects a specified phrase at the beginning of sentences, only if it is preceded by a sentence that also contains the phrase. The first sentence’s phrase is not selected.</strong></em></p>
<p dir="auto">When I showed what my “Mark” result was using his regex he confirmed that the highlighted text was exactly what he wanted removed. Unfortunately as he found out, and I had alluded to in an earlier post, the removal was an entirely different matter unless a reversal of lines was used.</p>
<p dir="auto">So if a line has the string Phrase A:, then remove that string if the preceding line also contained that string. So when replacing, say line 9 contains that string. If line 8 also had it, then remove the string from line 9. Now check line 10, if that had the same as line 9… Oh wait, I’ve just removed that from line 9, but as I’m a regex, I don’t remember that I did that so I don’t remove it from line 10. But I should have!</p>
<p dir="auto">This is all due to the lookbehind function which doesn’t help as we’ve possibly already changed the line before and now don’t know what it was. So what I’ve done is reversed the line order, so now it’s a lookahead. As such we’ve yet to process the next line so we CAN use the lookahead function with certainty.</p>
<p dir="auto">Terry</p>
]]></description><link>https://community.notepad-plus-plus.org/post/100312</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/100312</guid><dc:creator><![CDATA[Terry R]]></dc:creator><pubDate>Wed, 12 Mar 2025 23:56:42 GMT</pubDate></item><item><title><![CDATA[Reply to Why won't this PCRE regular expression work in Notepad++ when it works on regex101? on Wed, 12 Mar 2025 23:30:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/blohojo" aria-label="Profile: BlohoJo">@<bdi>BlohoJo</bdi></a> ,<br />
Not that I’m anywhere near an expert with Regex, but first off, Notepad++ does not use PCRE, it uses Boost which is patterned somewhat after PCRE.  Unless I misunderstand the conditions you want to test for, I did a very simple Search, Mark All, came up with the right solution, put it back into Replace mode and ran my Boost/NPP regex and it seems to have done exactly what your first example shows you desired. Not to take from <a class="plugin-mentions-user plugin-mentions-a" href="/user/terry-r" aria-label="Profile: Terry-R">@<bdi>Terry-R</bdi></a> or <a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: Coises">@<bdi>Coises</bdi></a> suggestions with the following regex and pics to show results.</p>
<pre><code>Find What = Phrase A\:\h?
Replace With = 
Search Mode = REGULAR EXPRESSION
Dot Matches Newline = NOT CHECKED
</code></pre>
<p dir="auto">Pics show the results:<br />
Mark Tab:<br />
<img src="/assets/uploads/files/1741820901381-pcrenotboost.png" alt="PCRENOTBOOST.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">Replace Tab: Replace All (selected)<br />
<img src="/assets/uploads/files/1741820901425-pcrenotboost2.png" alt="PCRENOTBOOST2.PNG" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/100310</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/100310</guid><dc:creator><![CDATA[Lycan Thrope]]></dc:creator><pubDate>Wed, 12 Mar 2025 23:30:33 GMT</pubDate></item><item><title><![CDATA[Reply to Why won't this PCRE regular expression work in Notepad++ when it works on regex101? on Wed, 12 Mar 2025 17:07:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/blohojo" aria-label="Profile: BlohoJo">@<bdi>BlohoJo</bdi></a> said in <a href="/post/100297">Why won't this PCRE regular expression work in Notepad++ when it works on regex101?</a>:</p>
<blockquote>
<p dir="auto">However, I was quite shocked to find that I now have no way to do what I want which is to DELETE the found phrases.</p>
<p dir="auto">I can’t select or delete marked text. I need to delete just the marked text, not the entire line, so Bookmarks don’t help here.</p>
</blockquote>
<p dir="auto">One option is to use the <strong>Search…</strong> dialog in the <a href="https://github.com/Coises/ColumnsPlusPlus" rel="nofollow ugc">Columns++</a> plugin. (You can install it from Plugins Admin.)</p>
<p dir="auto">That search acts in an indicated region; if you begin with nothing selected, it will set the search region to the entire document.</p>
<p dir="auto">On the dropdown menu for the <strong>Count</strong> button there is an option <strong>Select All</strong>. If you start with nothing selected, enter your search expression in the <strong>Find what</strong> box, set the <strong>Search Mode</strong> to <strong>Regular expression</strong> and then choose <strong>Select All</strong>, I believe that will do exactly what you want. You can then close the dialog and press the Delete key to delete the selected text.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/100306</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/100306</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Wed, 12 Mar 2025 17:07:57 GMT</pubDate></item><item><title><![CDATA[Reply to Why won't this PCRE regular expression work in Notepad++ when it works on regex101? on Wed, 12 Mar 2025 07:33:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/blohojo" aria-label="Profile: BlohoJo">@<bdi>BlohoJo</bdi></a><br />
So you still haven’t answered my questions, so I’ll just provide this answer and hope either I have it right or it will make you realise you may need to expand on what you really need.</p>
<p dir="auto">First run the “Reverse Line Order” under the Edit, Line Operations menu<br />
Then using the Replace function:<br />
Find What<code>(?-s)^(Phrase A: )(?=.*\R\1)</code><br />
Replace With: nothing in this field<br />
Lastly run the “Reverse Line Order” under the Edit, Line Operations menu</p>
<p dir="auto">Bear in mind there are often a few solutions available so others may also provide their input. It will be up to you to decide which fits your needs the best.</p>
<p dir="auto">Terry</p>
<p dir="auto">PS you can record all this as a macro and assign a shortcut so it is easy to re-run, especially if you are handing the job onto someone with less knowledge than yourself.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/100301</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/100301</guid><dc:creator><![CDATA[Terry R]]></dc:creator><pubDate>Wed, 12 Mar 2025 07:33:44 GMT</pubDate></item><item><title><![CDATA[Reply to Why won't this PCRE regular expression work in Notepad++ when it works on regex101? on Wed, 12 Mar 2025 06:49:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry-r" aria-label="Profile: Terry-R">@<bdi>Terry-R</bdi></a></p>
<p dir="auto"><img src="https://community.notepad-plus-plus.org/assets/uploads/files/1741758718965-e3216d45-c680-494b-9af2-26d00d365d55-image.png" alt="alt text" class=" img-fluid img-markdown" /></p>
<p dir="auto">I need to be able to delete the "<code>Phrase A: </code>" highlighted (marked) text in the above image. That’s it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/100300</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/100300</guid><dc:creator><![CDATA[BlohoJo]]></dc:creator><pubDate>Wed, 12 Mar 2025 06:49:11 GMT</pubDate></item><item><title><![CDATA[Reply to Why won't this PCRE regular expression work in Notepad++ when it works on regex101? on Wed, 12 Mar 2025 06:11:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/blohojo" aria-label="Profile: BlohoJo">@<bdi>BlohoJo</bdi></a> said in <a href="/post/100297">Why won't this PCRE regular expression work in Notepad++ when it works on regex101?</a>:</p>
<blockquote>
<p dir="auto">However, I was quite shocked to find that I now have no way to do what I want which is to DELETE the found phrases.</p>
</blockquote>
<p dir="auto">Now is the time to put forward the issue you have. So far you have only given scraps of information.</p>
<p dir="auto">As you did in the first post, show the example in the first code box before the change happens, then the same example with the changes made in another box. When you remove those marked text did the remaining line get padded with spaces, or appended to the previous line, or maybe shoved left due to characters being removed?</p>
<p dir="auto">Expand on the problem detail. I sort of get what you want but there are some gaps in the details which could affect the solution.</p>
<p dir="auto">I will say that a possibility might be to reverse the lines before deleting text and reverse them again. It’s only a guess as I say, there are gaps in the details.</p>
<p dir="auto">Terry</p>
]]></description><link>https://community.notepad-plus-plus.org/post/100298</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/100298</guid><dc:creator><![CDATA[Terry R]]></dc:creator><pubDate>Wed, 12 Mar 2025 06:11:29 GMT</pubDate></item><item><title><![CDATA[Reply to Why won't this PCRE regular expression work in Notepad++ when it works on regex101? on Wed, 12 Mar 2025 06:04:24 GMT]]></title><description><![CDATA[<p dir="auto">I apologize, I swore I was on the latest version, but I wasn’t. After updating to version 8.7.8, the expression now works for the “Mark” tab and also the “Find all”.</p>
<p dir="auto">However, I was quite shocked to find that I now have no way to do what I want which is to DELETE the found phrases.</p>
<p dir="auto">I can’t select or delete marked text. I need to delete just the marked text, not the entire line, so Bookmarks don’t help here.</p>
<p dir="auto">If I do a “Find all” it opens in a separate panel again with the searched phrase highlighted, there is no way to select <em>just</em> the phrase. I would need to be able to do a column mode selection in the search results panel, but you can’t. All I can do is double click on one highlighted phrase and it selects only a single phrase on a single line.</p>
<p dir="auto">Find/replace doesn’t work here due to the nature of the regular expression. If I try to do that, it misses about half of the phrases because find/replace works line by line, which affects the results.</p>
<p dir="auto">The simplest solution would be a “select marked text,” then the user could copy, paste over, delete, or do anything that you can do with a selection.</p>
<p dir="auto">So for now, I guess I just have to use the online resource regex101, as all I have to do is click on “Substitution” and I get the result I need instantly. I’d rather be able to do it local though.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/100297</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/100297</guid><dc:creator><![CDATA[BlohoJo]]></dc:creator><pubDate>Wed, 12 Mar 2025 06:04:24 GMT</pubDate></item><item><title><![CDATA[Reply to Why won't this PCRE regular expression work in Notepad++ when it works on regex101? on Wed, 12 Mar 2025 05:58:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/blohojo" aria-label="Profile: BlohoJo">@<bdi>BlohoJo</bdi></a> said in <a href="/post/100293">Why won't this PCRE regular expression work in Notepad++ when it works on regex101?</a>:</p>
<blockquote>
<p dir="auto">However, it doesn’t work in Notepad++</p>
</blockquote>
<p dir="auto">Not sure why you consider it doesn’t work because I replicated your setup (data and regular expression) and got what you wanted. See:</p>
<p dir="auto"><img src="/assets/uploads/files/1741758718965-e3216d45-c680-494b-9af2-26d00d365d55-image.png" alt="e3216d45-c680-494b-9af2-26d00d365d55-image.png" class=" img-fluid img-markdown" /> .</p>
<p dir="auto">About all I can say is you included the leading forward slash and the trailing <code>/gm</code>. They aren’t a part of the expression. You also mention it not working with numbers, what do you mean?</p>
<p dir="auto">Please recheck for yourself and come back with a similar image to what I included showing your issue if you can show it doesn’t work for you.</p>
<p dir="auto">I’m wondering if you have used AI to create this expression and really know nothing about regular expressions, if so you are in dangerous territory. Trying to use something and relying on the outcome without any knowledge will only lead to disaster.</p>
<p dir="auto">Terry</p>
]]></description><link>https://community.notepad-plus-plus.org/post/100294</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/100294</guid><dc:creator><![CDATA[Terry R]]></dc:creator><pubDate>Wed, 12 Mar 2025 05:58:43 GMT</pubDate></item></channel></rss>