<?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-in-FIles: Can’t Replace Multiple Instances of Word]]></title><description><![CDATA[<p dir="auto">I’m writing a regular expression to replace words in an HTML file. To match<br />
the regex, the word to replace must:</p>
<ol>
<li>
<p dir="auto">Be some where after the occurrence of the string “lyrics-text” (I’m editing song lyrics).</p>
</li>
<li>
<p dir="auto">Must not be at the start of a line, and not immediately after &lt;p&gt; or &lt;p class=“chorus”&gt;.</p>
</li>
</ol>
<p dir="auto">My regex:</p>
<p dir="auto">FIND</p>
<pre><code>lyrics-text.+?(?&lt;!^)(?&lt;!&lt;p&gt;)(?&lt;!&lt;p class="chorus"&gt;)\Kword_to_find(?=(.+?&lt;/div&gt;))
</code></pre>
<p dir="auto">REPLACE WITH:</p>
<pre><code>replacement_word
</code></pre>
<p dir="auto">When I manually run the regex against a single file using the <strong>Find</strong> dialog, <strong>Replace</strong> tab, I check the boxes <strong>Match case</strong>, <strong>Wrap around</strong> &amp; <strong>. matches newline</strong>, and the replacement works as expected. If there are multiple instances of <strong>word_to_find</strong> in the file, it replaces them one at a time as I click <strong>Replace</strong>.</p>
<p dir="auto">However, when I try the replacement using the <strong>Find in Files</strong> tab and the <strong>Replace in Files</strong> button, it replaces only the <em>first</em> instance of the <strong>word_to_find</strong> in each file. <strong>Subsequent instances of <strong>word_to_find</strong> in the same file are ignored.</strong></p>
<p dir="auto">I don’t see any options on the <strong>Find in Files</strong> tab regarding multiple matches. What am I missing?</p>
<p dir="auto">I can provide a sample file if needed, but was trying to keep the question as simple as possible.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/25451/find-in-files-can-t-replace-multiple-instances-of-word</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 10:27:17 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/25451.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 Feb 2024 01:36:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Tue, 06 Feb 2024 12:35:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sylvester-bullitt" aria-label="Profile: Sylvester-Bullitt">@<bdi>Sylvester-Bullitt</bdi></a> Got done generating broken link report.</p>
<p dir="auto">THE GOOD NEWS: My regex didn’t break any links</p>
<p dir="auto">THE BAD NEWS: I just go lucky. Some further testing revealed that my regex <strong>would</strong> have broken links, if I had had the bad luck to use a search term that also in a hyperlink URL.</p>
<p dir="auto">So, I added lookaheads  to ignore matches of underscores and .htm, and it seems to work. In case anyone’s interested, here’s the new-and-improved regex, with some comments added for clarity:</p>
<pre><code>(?-si:&lt;section class="lyrics"&gt;|(?!\A)\G)(?s-i:(?!&lt;/section&gt;).)*?(?#Not at start of line or para)(?&lt;!^)(?&lt;!&lt;p&gt;)(?&lt;!&lt;p class="chorus"&gt;)\K(?-si:\bWORD_TO_FIND\bq(?#Not in hyperlink)(?!(\.htm))(?!_))
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/92706</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92706</guid><dc:creator><![CDATA[Sylvester Bullitt]]></dc:creator><pubDate>Tue, 06 Feb 2024 12:35:51 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Tue, 06 Feb 2024 11:34:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> First, let me thank you for the work you’ve done on helping develop generic regex solutions. And you’ right, the solution I mentioned yesterday, which I was testing, seemed to be very promising.</p>
<p dir="auto">However, I woke up in the middle of last night, and realized that we may have overlooked a potential pitfall. As you may remember, my ultimate objective was to modify texts in song lyrics, and the <a href="https://community.notepad-plus-plus.org/topic/22690/generic-regex-replacing-in-a-specific-zone-of-text">generic regex</a> on the Notepad++ site seems to be an ideal fit for my use case.</p>
<p dir="auto">Though it seems to be working well so far, I’m wondering if we overlooked one thing: the <strong>the search term might be part of a hyperlink URL</strong>, and thus should not be changed. I’m running a hyperlink report on the Web site now to see if any of the links have been broken. I I don’t know the answer yet, but I should know within the next hour.</p>
<p dir="auto">If the regex did indeed match/modify/break some URLs, I plan to   ad a negative lookahead to exclude matches which precede  <strong>.htm</strong> or an  <strong>underscore</strong>. Hopefully that will be enough to prevent us from inadvertently changing links.</p>
<p dir="auto">Have you run into the issue of breaking HTML links with a regex search-and-replace before?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92702</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92702</guid><dc:creator><![CDATA[Sylvester Bullitt]]></dc:creator><pubDate>Tue, 06 Feb 2024 11:34:29 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Tue, 06 Feb 2024 09:54:06 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <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/sylvester-bullitt" aria-label="Profile: sylvester-bullitt">@<bdi>sylvester-bullitt</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a> and <strong>All</strong>,</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: coises">@<bdi>coises</bdi></a>, you said in a <strong>previous</strong> post :</p>
<blockquote>
<p dir="auto">No regular expression thread is finished until <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> drops in to tell us that there’s a better way to do it.</p>
</blockquote>
<p dir="auto">Well, many thanks, <a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: coises">@<bdi>coises</bdi></a>, for your <strong>kind</strong> words, but I, definitively, do <strong>not</strong> deserve this <strong>honor</strong>, because <strong>you</strong> and some other people could easily be <strong>included</strong> in this list !</p>
<p dir="auto">I noticed that, given the <strong>large</strong> number of <strong>regex</strong> solutions, that most of us have been proposing for some time now, we’re getting <strong>fewer</strong> questions on this subject. To my mind, this means that the general <strong>level</strong> of N++ users, regarding the <strong>regex</strong> world, is <strong>increasing</strong> which is, globally, a good thing for a better N++ use, along with the other script solutions and their <strong>workflow</strong> !</p>
<p dir="auto">I suppose, that the <strong>regex</strong> section, described in the <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>’s official <strong>documentation</strong>, did help some of us, too, from time to time !</p>
<hr />
<p dir="auto">BTW, I did not drop in this discussion, but the <strong>generic regex</strong>, suggested by <a class="plugin-mentions-user plugin-mentions-a" href="/user/sylvester-bullitt" aria-label="Profile: sylvester-bullitt">@<bdi>sylvester-bullitt</bdi></a>, in its <strong>last</strong> post, seems to be the <strong>right</strong> solution</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92700</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92700</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Tue, 06 Feb 2024 09:54:06 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 23:22:37 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> As Peter suggested a few minutes ago, we’re now trying the approach shown at <a href="https://community.notepad-plus-plus.org/topic/22690/generic-regex-replacing-in-a-specific-zone-of-text">https://community.notepad-plus-plus.org/topic/22690/generic-regex-replacing-in-a-specific-zone-of-text</a></p>
<p dir="auto">Based in the example there, we’re testing this regex:</p>
<pre><code>(?-si:&lt;section class="lyrics"&gt;|(?!\A)\G)(?s-i:(?!&lt;/section&gt;).)*?(?&lt;!^)(?&lt;!&lt;p&gt;)(?&lt;!&lt;p class="chorus"&gt;)\K(?-si:\bWORD_TO_FIND\b)
</code></pre>
<p dir="auto">We also discovered a blemish in our previous version: The quote marks around the word “chorus” were typographical, and should have been standards typewriter-style quotes (").</p>
<p dir="auto">We’ve been testing the regex above on live Web site files, and so far things are going well (fingers crossed as tightly as ever!).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92696</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92696</guid><dc:creator><![CDATA[Sylvester Bullitt]]></dc:creator><pubDate>Mon, 05 Feb 2024 23:22:37 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 23:16:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sylvester-bullitt" aria-label="Profile: Sylvester-Bullitt">@<bdi>Sylvester-Bullitt</bdi></a> said in <a href="/post/92692">Find-in-FIles: Can’t Replace Multiple Instances of Word</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: Coises">@<bdi>Coises</bdi></a> Is the glitch in the regular expression itself, or in the regex engine?</p>
</blockquote>
<p dir="auto">The expression. After testing, it appears that my variant, which avoids matching files that don’t contain <strong><code>lyrics-text</code></strong>, also fixes this problem. Applying a small simplification to the previous version (the <strong><code>\G</code></strong> was unnecessary) this:</p>
<pre><code class="language-text">(?s)(\A.*?(lyrics-text|\Z(*COMMIT)(*FAIL)).*?|)(?&lt;!^)(?&lt;!&lt;p&gt;)(?&lt;!&lt;p class="chorus"&gt;)\Ksavior(?=(.+?&lt;/div&gt;))
</code></pre>
<p dir="auto">matches nothing, as it should; this:</p>
<pre><code class="language-text">(?s)(\A.*?(lyrics-text|\Z(*COMMIT)(*FAIL)).*?|)(?&lt;!^)(?&lt;!&lt;p&gt;)(?&lt;!&lt;p class="chorus"&gt;)\Ksav\xADior(?=(.+?&lt;/div&gt;))
</code></pre>
<p dir="auto">matches the the single occurrence of the word (which is hyphenated using a “soft hyphen”) in the lyrics, on line 63.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92695</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92695</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Mon, 05 Feb 2024 23:16:53 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 22:44:33 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> said in <a href="/post/92689">Find-in-FIles: Can’t Replace Multiple Instances of Word</a>:</p>
<blockquote>
<p dir="auto">No regular expression thread is finished until <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> drops in to tell us that there’s a better way to do it.</p>
</blockquote>
<p dir="auto">No kidding.  But with the most recent failure, I think <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a>’s FAQ has already given us the solution that we should have used, if the OP had not stated it as an XY-Problem.</p>
<p dir="auto">Looking at the example data, I think the better problem statement would be "please replace all instances of <strong>WORD_TO_FIND</strong> between the start <code>&lt;section class="lyrics"</code> and end <code>&lt;/section&gt;</code>  .  With that set of rules, just use the <a href="/topic/22690">Generic Regex Formula &gt; Replace in a specific zone of text</a>, with <strong>FR</strong> = <code>\bWORD_TO_FIND\b</code>, and my “start” and “end” a sentence ago are the <strong>BSR</strong> and <strong>ESR</strong>.  (Though you might have to add your <code>(?&lt;!^)(?&lt;!&lt;p&gt;)(?&lt;!&lt;p class="chorus"&gt;)</code> restrictions to the <strong>FR</strong>)</p>
<blockquote>
<p dir="auto">Is the glitch in the regular expression itself, or in the regex engine?</p>
</blockquote>
<p dir="auto">The “glitch” is the expectation that one can safely edit HTML with regex (see <a href="https://community.notepad-plus-plus.org/post/91651">FAQ</a>).  Since I’m sure you’ll insist on it anyway, then dealing with glitches is something you must expect, and that you must start putting effort into.</p>
<p dir="auto">We’ve gone above-and-beyond in getting it working this well for you.  At this point, it’s really time for you to start reading the same documentation that we’re reading, and try to figure it out on your own.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92693</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92693</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 05 Feb 2024 22:44:33 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 22:39:30 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> Is the glitch in the regular expression itself, or in the regex engine?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92692</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92692</guid><dc:creator><![CDATA[Sylvester Bullitt]]></dc:creator><pubDate>Mon, 05 Feb 2024 22:39:30 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 22:35:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sylvester-bullitt" aria-label="Profile: Sylvester-Bullitt">@<bdi>Sylvester-Bullitt</bdi></a></p>
<p dir="auto">You’ve found another glitch:</p>
<p dir="auto">If there are no matches following <strong><code>lyrics-text</code></strong>, the expression we’ve suggested will match from the beginning of the file.</p>
<p dir="auto">All three matches are in the head section of the document. There are no matches after <strong><code>lyrics-text</code></strong>, because the word is hyphenated in the lyrics text.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92690</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92690</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Mon, 05 Feb 2024 22:35:06 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 22:21:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sylvester-bullitt" aria-label="Profile: Sylvester-Bullitt">@<bdi>Sylvester-Bullitt</bdi></a> said in <a href="/post/92686">Find-in-FIles: Can’t Replace Multiple Instances of Word</a>:</p>
<blockquote>
<p dir="auto">Does anyone have any more pearls of wisdom to add to this adventure?</p>
</blockquote>
<p dir="auto">Be aware that these expressions match parts of words; e.g., the “star” in “starlight” or “restart” will be matched. I’ll leave it as an exercise for you to study a bit and attempt to find a fix for that, if it is a problem.</p>
<p dir="auto">No regular expression thread is finished until <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> drops in to tell us that there’s a better way to do it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92689</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92689</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Mon, 05 Feb 2024 22:21:35 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 22:03:58 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> I spoke to soon. Sigh.</p>
<p dir="auto">I just ran this regex against live Web site files (fortunately, just <strong>Find All</strong>, not replacing anything yet):</p>
<pre><code>(?s)(\A.*?lyrics-text|\G).+?(?&lt;!^)(?&lt;!&lt;p&gt;)(?&lt;!&lt;p class=“chorus”&gt;)\KSavior(?=(.+?&lt;/div&gt;))
</code></pre>
<p dir="auto">This regex had ignored the <strong>&lt;title&gt;</strong> element in my earlier tests, but it did <strong>not</strong> ignore the title in the file text below (i.e., it matched the word Savior in the title). Can anyone see why?</p>
<pre><code>&lt;!DOCTYPE HTML&gt;
&lt;html lang="en-us"&gt;

&lt;head&gt;
&lt;meta charset="utf-8"&gt;
&lt;title&gt;Alas! and Did My Savior Bleed?&lt;/title&gt;
&lt;meta name="alt-title" content="At the Cross"&gt;
&lt;meta name="description" content="Words: Isaac Watts, 1709. Music: Hugh Wilson, 1800."&gt;
&lt;meta name="keywords" content="Isaac Watts,Hugh Wilson,Ralph Hudson"&gt;
&lt;link rel="stylesheet" href="../../../../../css/hymn.css"&gt;
&lt;script src="../../../../../js/jquery.js"&gt;&lt;/script&gt;
&lt;script src="../../../../../js/languages.js"&gt;&lt;/script&gt;
&lt;script src="../../../../../js/base.js"&gt;&lt;/script&gt;
&lt;script src="../../../../../js/hymn.js"&gt;&lt;/script&gt;
&lt;link rel="prev" href="../../../i/r/f/airfille.htm"&gt;
&lt;link rel="next" href="../../../b/n/a/abnature.htm"&gt;
&lt;link rel="up" href="../../../../../ttl/ttl-a.htm"&gt;
&lt;link rel="alternate" href="../../../../../non/es/e/n/l/a/enlacruz.htm" hreflang="es"&gt;
&lt;link rel="alternate" href="../../../../../non/ml/a/l/a/s/alas_and_did_my_savior_bleed_ml.htm" hreflang="ml"&gt;
&lt;link rel="alternate" href="../../../../../non/ml/a/l/a/s/alas_and_did_my_savior_bleed_2_ml.htm" hreflang="ml"&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;section&gt;
&lt;h1 class="screen-reader-only"&gt;Scripture Verse&lt;/h1&gt;
&lt;div class="css-marquee" role="marquee"&gt;
&lt;p&gt;&lt;q&gt;There is one God and one mediator between God and men, the man Christ Jesus, who gave Himself as a ransom for all men.&lt;/q&gt; 1 Timothy 2:5–6&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;

&lt;section id="preface"&gt;
&lt;h1 class="screen-reader-only"&gt;Introduction&lt;/h1&gt;
&lt;figure&gt;&lt;img alt="portrait" src="../../../../../img/w/a/t/t/watts_i.jpg" width="200" height="300"&gt;&lt;figcaption&gt;Isaac Watts&lt;br&gt;1674–1748&lt;/figcaption&gt;&lt;/figure&gt;
&lt;div class="preface-text"&gt;
&lt;p&gt;&lt;span class="lead"&gt;Words:&lt;/span&gt; &lt;a href="../../../../../bio/w/a/t/t/watts_i.htm"&gt;Is­aac Watts&lt;/a&gt;, &lt;cite class="book verbose"&gt;Hymns and Spi­ri­tu­al Songs&lt;/cite&gt; 1707–09&lt;span class="verbose"&gt;, Book 2, num­ber 9. &lt;q&gt;God­ly sor­row aris­ing from the suf­fer­ings of Christ.&lt;/q&gt; &lt;a href="../../../../../bio/h/u/d/s/hudson_re.htm"&gt;Ralph E. Hud­son&lt;/a&gt; wrote the re­frain in 1885&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;span class="lead"&gt;Music:&lt;/span&gt; &lt;span class="music verbose"&gt;Mar­tyr­dom&lt;/span&gt; &lt;a href="../../../../../bio/w/i/l/s/o/n/h/wilson_h.htm"&gt;Hugh Wil­son&lt;/a&gt;, 1800 (&lt;a href="../../../../../mid/m/a/r/t/martyrdom.mid" title="Listen to music, MIDI format"&gt;🔊&lt;/a&gt; &lt;a href="../../../../../pdf/en/m/a/r/t/Martyrdom.pdf" title="Download score, PDF format"&gt;pdf&lt;/a&gt; &lt;a href="../../../../../nwc/m/a/r/t/Martyrdom.nwc" title="Download score, Noteworthy Composer format"&gt;nwc&lt;/a&gt;)&lt;span class="verbose"&gt; (does not use the re­frain)&lt;/span&gt;.&lt;/p&gt;
&lt;div class="alt-tune"&gt;
&lt;p&gt;Alternate Tunes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Abney (Hull)&lt;/span&gt; &lt;a href="../../../../../bio/h/u/l/l/hull_a.htm"&gt;Asa Hull&lt;/a&gt; (1828–1907) (&lt;a href="../../../../../mid/a/b/n/e/abney_hull.mid" title="Listen to music, MIDI format"&gt;🔊&lt;/a&gt; &lt;a href="../../../../../pdf/en/a/b/n/e/Abney(Hull).pdf" title="Download score, PDF format"&gt;pdf&lt;/a&gt; &lt;a href="../../../../../nwc/a/b/n/e/Abney(Hull).nwc" title="Download score, Noteworthy Composer format"&gt;nwc&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Hudson&lt;/span&gt; &lt;a href="../../../../../bio/h/u/d/s/hudson_re.htm"&gt;Ralph E. Hud­son&lt;/a&gt;, &lt;cite class="book"&gt;Songs of Peace, Love and Joy&lt;/cite&gt; (&lt;span class="map" onclick="show('Alliance,OH')"&gt;Al­li­ance&lt;/span&gt; Ohio: 1885) (&lt;a href="../../../../../mid/h/u/d/s/hudson.mid" title="Listen to music, MIDI format"&gt;🔊&lt;/a&gt; &lt;a href="../../../../../pdf/en/a/t/t/h/AtTheCross.pdf" title="Download score, PDF format"&gt;pdf&lt;/a&gt; &lt;a href="../../../../../nwc/a/t/t/h/AtTheCross.nwc" title="Download score, Noteworthy Composer format"&gt;nwc&lt;/a&gt;) (us­es re­frain be­low). It is with this tune that the hymn is known as &lt;span class="hymn-title"&gt;At the Cross.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Liberty Hall&lt;/span&gt; in &lt;cite class="book"&gt;Wy­eth’s Re­po­si­to­ry of Sac­red Mu­sic&lt;/cite&gt;, by &lt;a href="../../../../../bio/w/y/e/t/wyeth_j.htm"&gt;John Wy­eth&lt;/a&gt;, 1810 (&lt;a href="../../../../../mid/l/i/b/e/liberty_hall.mid" title="Listen to music, MIDI format"&gt;🔊&lt;/a&gt; &lt;a href="../../../../../pdf/en/l/i/b/e/LibertyHall.pdf" title="Download score, PDF format"&gt;pdf&lt;/a&gt; &lt;a href="../../../../../nwc/l/i/b/e/LibertyHall.nwc" title="Download score, Noteworthy Composer format"&gt;nwc&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;
&lt;figure&gt;&lt;img alt="illustration" src="../../../../../img/c/r/u/c/Crucifixion,SimonVouet.jpg" height="300" width="200"&gt;&lt;figcaption&gt;Crucifixion&lt;br&gt;Simon Vouet&lt;br&gt;1590–1649&lt;/figcaption&gt;&lt;/figure&gt;
&lt;/section&gt;

&lt;section&gt;
&lt;h1 class="screen-reader-only"&gt;Background&lt;/h1&gt;
&lt;blockquote class="verbose mc"&gt;
&lt;p&gt;[In] the au­tumn of 1850…re­viv­al meet­ings were be­ing held in the Thir­ti­eth Street Me­tho­dist Church. Some of us went down ev­ery ev­en­ing; and, on two oc­ca­sions, I sought peace at the atlar [sic], but did not find the joy I craved, un­til one ev­en­ing, No­vem­ber 20, 1850, it seemed to me that the light must in­deed come then or ne­ver; and so I arose and went to the al­tar alone. Af­ter a pray­er was of­fered, they be­gan to sing the grand old con­se­cr­ation hymn,&lt;/p&gt;
&lt;p lang="en-gb"&gt;&lt;q&gt;Alas, and did my Sav­iour bleed, and did my So­ve­reign die?&lt;/q&gt;&lt;/p&gt;
&lt;p&gt;And when they reached the third line of the fourth stan­za,&lt;/p&gt;
&lt;p&gt;&lt;q&gt;Here Lord, I give my­self away,&lt;/q&gt;&lt;/p&gt;
&lt;p&gt;My very soul was flood­ed with a ce­les­tial light. I sprang to my feet, shout­ing &lt;q&gt;hal­le­lu­jah,&lt;/q&gt; and then for the first time I real­ized that I had been try­ing to hold the world in one hand and the Lord in the oth­er.&lt;/p&gt;
&lt;p&gt;&lt;a href="../../../../../bib/c/crosby.htm"&gt;Crosby&lt;/a&gt;, p. 24&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/section&gt;

&lt;section class="lyrics"&gt;
&lt;div class="audio"&gt;&lt;audio class="primary" controls loop&gt;&lt;source src="../../../../../ogg/m/a/r/t/martyrdom.ogg" type="audio/ogg"&gt;&lt;/audio&gt;&lt;/div&gt;
&lt;h1 class="screen-reader-only"&gt;Lyrics&lt;/h1&gt;
&lt;div class="stanzas"&gt;&lt;div class="lyrics-text mc ll"&gt;
&lt;p&gt;Alas! and did my Sav­ior bleed&lt;br&gt;
And did my So­ver­eign die?&lt;br&gt;
Would He de­vote that sac­red head&lt;br&gt;
For such a worm as I?&lt;/p&gt;
&lt;p class="chorus"&gt;Refrain&lt;/p&gt;
&lt;p class="chorus"&gt;At the cross, at the cross where I first saw the light,&lt;br&gt;
And the bur­den of my heart rolled away,&lt;br&gt;
It was there by faith I re­ceived my sight,&lt;br&gt;
And now I am hap­py all the day!&lt;/p&gt;
&lt;p&gt;Thy bo­dy slain, sweet Je­sus, Thine,&lt;br&gt;
And bathed in its own blood,&lt;br&gt;
While all ex­posed to wrath di­vine,&lt;br&gt;
The glo­ri­ous Suf­fer­er stood!&lt;/p&gt;
&lt;p class="chorus"&gt;Refrain&lt;/p&gt;
&lt;p&gt;Was it for crimes that I had done&lt;br&gt;
He groaned up­on the tree?&lt;br&gt;
Amazing pi­ty! grace un­known!&lt;br&gt;
And love be­yond de­gree!&lt;/p&gt;
&lt;p class="chorus"&gt;Refrain&lt;/p&gt;
&lt;p&gt;Well might the sun in dark­ness hide&lt;br&gt;
And shut his glo­ries in,&lt;br&gt;
When Christ, the migh­ty Mak­er died,&lt;br&gt;
For man the crea­ture’s sin.&lt;/p&gt;
&lt;p class="chorus"&gt;Refrain&lt;/p&gt;
&lt;p&gt;Thus might I hide my blush­ing face&lt;br&gt;
While His dear cross ap­pears,&lt;br&gt;
Dissolve my heart in thank­ful­ness,&lt;br&gt;
And melt my eyes to tears.&lt;/p&gt;
&lt;p class="chorus"&gt;Refrain&lt;/p&gt;
&lt;p&gt;But drops of grief can ne’er re­pay&lt;br&gt;
The debt of love I owe:&lt;br&gt;
Here, Lord, I give my self away&lt;br&gt;
’Tis all that I can do.&lt;/p&gt;
&lt;p class="chorus"&gt;Refrain&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;/section&gt;

&lt;/body&gt;
&lt;/html&gt;

</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/92688</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92688</guid><dc:creator><![CDATA[Sylvester Bullitt]]></dc:creator><pubDate>Mon, 05 Feb 2024 22:03:58 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 21:52:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sylvester-bullitt" aria-label="Profile: Sylvester-Bullitt">@<bdi>Sylvester-Bullitt</bdi></a> said in <a href="/post/92682">Find-in-FIles: Can’t Replace Multiple Instances of Word</a>:</p>
<blockquote>
<ol start="3">
<li>What is the construct that resembles a lookbehind, but has the asterisk &amp; question mark?</li>
</ol>
</blockquote>
<p dir="auto">That was answered <a href="https://community.notepad-plus-plus.org/post/92680">here</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/92687</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92687</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 05 Feb 2024 21:52:44 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 21:45:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sylvester-bullitt" aria-label="Profile: Sylvester-Bullitt">@<bdi>Sylvester-Bullitt</bdi></a> Good news!</p>
<p dir="auto">Testing the new-and-improved regex against 2 files on disk worked perfectly!</p>
<p dir="auto">It even worked when I had to undo a mistake with the replacement string, changing it to the one I <em>really</em> meant (I just changed the regex and clicked <strong>Replace All</strong> again).</p>
<p dir="auto">So for now (fingers tightly crossed), it looks like we can declare victory! Does anyone have any more pearls of wisdom to add to this adventure?</p>
<p dir="auto">Thank you so much for for your help and patience.</p>
<p dir="auto">By the way, if you’d like to see the Web site where this will be used, <a href="http://www.hymntime.com/tch/" rel="nofollow ugc">click here</a>!</p>
<p dir="auto">Cheers!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92686</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92686</guid><dc:creator><![CDATA[Sylvester Bullitt]]></dc:creator><pubDate>Mon, 05 Feb 2024 21:45:08 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 21:44:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sylvester-bullitt" aria-label="Profile: Sylvester-Bullitt">@<bdi>Sylvester-Bullitt</bdi></a> said in <a href="/post/92682">Find-in-FIles: Can’t Replace Multiple Instances of Word</a>:</p>
<blockquote>
<p dir="auto">I just tried Coises’ suggested modification to the regex:</p>
</blockquote>
<p dir="auto">That was <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a>, not me. I was in the process of writing a post explaining why it couldn’t be done when he posted showing how to do it.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92685</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92685</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Mon, 05 Feb 2024 21:44:15 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 21:39:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sylvester-bullitt" aria-label="Profile: Sylvester-Bullitt">@<bdi>Sylvester-Bullitt</bdi></a></p>
<p dir="auto">Suggested reading:</p>
<p dir="auto"><a href="https://www.boost.org/doc/libs/1_84_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html" rel="nofollow ugc">Perl Regular Expression Syntax</a><br />
<a href="https://www.boost.org/doc/libs/1_84_0/libs/regex/doc/html/boost_regex/format/boost_format_syntax.html" rel="nofollow ugc">Boost-Extended Format String Syntax</a></p>
<p dir="auto">Notepad++ uses the Boost regular expression library. The above links are to the documentation for the current version; I believe Notepad++ is a couple minor versions behind, but there should be little or no practical difference.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92684</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92684</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Mon, 05 Feb 2024 21:39:11 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 21:28:48 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> “I see,” said the blind carpenter, as he picked up his hammer and saw!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92683</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92683</guid><dc:creator><![CDATA[Sylvester Bullitt]]></dc:creator><pubDate>Mon, 05 Feb 2024 21:28:48 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 21:26:51 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> Three things:</p>
<ol>
<li>
<p dir="auto">Yes, all the files (assuming they’re generated properly from my template) have the string <strong>lyrics-text</strong>.</p>
</li>
<li>
<p dir="auto">I just tried Coises’ suggested modification to the regex:</p>
</li>
</ol>
<pre><code>(?s)(\A.*?lyrics-text|\G).+?(?&lt;!^)(?&lt;!&lt;p&gt;)(?&lt;!&lt;p class=“chorus”&gt;)\Klamb(?=(.+?&lt;/div&gt;))
</code></pre>
<p dir="auto">As advertised, it no longer matches the Lamb in the &lt;title&gt; tag, which is the desired behavior, since we’re only changing lyrics.</p>
<ol start="3">
<li>What is the construct that resembles a lookbehind, but has the asterisk &amp; question mark? That is,</li>
</ol>
<pre><code>(\A.*?lyrics-text|\G)
</code></pre>
<p dir="auto">Still testing, but things are looking more and more promising!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92682</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92682</guid><dc:creator><![CDATA[Sylvester Bullitt]]></dc:creator><pubDate>Mon, 05 Feb 2024 21:26:51 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 21:28:21 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> said in <a href="/post/92679">Find-in-FIles: Can’t Replace Multiple Instances of Word</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sylvester-bullitt" aria-label="Profile: Sylvester-Bullitt">@<bdi>Sylvester-Bullitt</bdi></a> said in <a href="/post/92678">Find-in-FIles: Can’t Replace Multiple Instances of Word</a>:</p>
<blockquote>
<p dir="auto">Ships passing in the night.</p>
</blockquote>
<p dir="auto">More than that, you aren’t noticing all the posts because of the rapid posting.</p>
<p dir="auto">I already explained exactly what happened with <code>\G</code> ion <a href="https://community.notepad-plus-plus.org/post/92672">this post</a>, which contains a fix for the <code>\G</code> issue.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: Coises">@<bdi>Coises</bdi></a>’s follow-on showed that if any of your files don’t have <code>lyrics-text</code> at all, then my fix-for-<code>\G</code> will replace all instances of <code>star</code> or <code>lamb</code> or what have you – but I’m hoping, for your sake, that all the files that your Find in Files filter will match will contain <code>lyrics-text</code> somewhere.</p>
</blockquote>
<p dir="auto">Took me this long to get it (so I’ll post here rather than editing my earlier comment), but I think:</p>
<pre><code class="language-text">(?s)(\A.*?(lyrics-text|\Z(*COMMIT)(*FAIL))|\G).+?(?&lt;!^)(?&lt;!&lt;p&gt;)(?&lt;!&lt;p class="chorus"&gt;)\Kstar(?=(.+?&lt;/div&gt;))
</code></pre>
<p dir="auto">fixes that problem.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92681</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92681</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Mon, 05 Feb 2024 21:28:21 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 21:19:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sylvester-bullitt" aria-label="Profile: Sylvester-Bullitt">@<bdi>Sylvester-Bullitt</bdi></a> said in <a href="/post/92675">Find-in-FIles: Can’t Replace Multiple Instances of Word</a>:</p>
<blockquote>
<p dir="auto"><code>(?:lyrics-text|\G)</code></p>
</blockquote>
<p dir="auto"><code>(?:...)</code> is a <a href="https://npp-user-manual.org/docs/searching/#readability-enhancements" rel="nofollow ugc">non-capturing subgroup</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92680</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92680</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 05 Feb 2024 21:19:23 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 21:16:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sylvester-bullitt" aria-label="Profile: Sylvester-Bullitt">@<bdi>Sylvester-Bullitt</bdi></a> said in <a href="/post/92678">Find-in-FIles: Can’t Replace Multiple Instances of Word</a>:</p>
<blockquote>
<p dir="auto">Ships passing in the night.</p>
</blockquote>
<p dir="auto">More than that, you aren’t noticing all the posts because of the rapid posting.</p>
<p dir="auto">I already explained exactly what happened with <code>\G</code> ion <a href="https://community.notepad-plus-plus.org/post/92672">this post</a>, which contains a fix for the <code>\G</code> issue.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: Coises">@<bdi>Coises</bdi></a>’s follow-on showed that if any of your files don’t have <code>lyrics-text</code> at all, then my fix-for-<code>\G</code> will replace all instances of <code>star</code> or <code>lamb</code> or what have you – but I’m hoping, for your sake, that all the files that your Find in Files filter will match will contain <code>lyrics-text</code> somewhere.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92679</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92679</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 05 Feb 2024 21:16:56 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 21:11:35 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> Ships passing in the night.</p>
<p dir="auto">I just made a post saying when I searched for the word <strong>lamb</strong>, it also found the word <strong>Lamb</strong> in the <strong>&lt;title&gt;</strong>, not just after <strong>lyrics-text</strong>. Search text:</p>
<pre><code>&lt;!DOCTYPE HTML&gt;
&lt;html lang="en-us"&gt;

&lt;head&gt;
&lt;meta charset="utf-8"&gt;
&lt;title&gt;Mary Had a Little Lamb&lt;/title&gt;
&lt;meta name="description" content="Words: Sarah Hale, 1830. Music: None."&gt;
&lt;meta name="keywords" content="Sarah Hale"&gt;
&lt;link rel="stylesheet" href="../../css/hymn.css"&gt;
&lt;script src="../../js/jquery.js"&gt;&lt;/script&gt;
&lt;script src="../../js/base.js"&gt;&lt;/script&gt;
&lt;script src="../../js/hymn.js"&gt;&lt;/script&gt;
&lt;link rel="prev" href="../../htm/h/e/w/o/hewonsav.htm"&gt;
&lt;link rel="next" href="../../htm/h/e/s/a/hesallwo.htm"&gt;
&lt;link rel="up" href="../../ttl/ttl-h.htm"&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;section id="preface"&gt;
&lt;h1 class="screen-reader-only"&gt;Introduction&lt;/h1&gt;
&lt;div class="preface-text"&gt;
&lt;p&gt;&lt;span class="lead"&gt;Words:&lt;/span&gt; &lt;a href="../../bio/h/a/l/e/hale_sjb.htm"&gt;Sarah J. Hale&lt;/a&gt;, 1830.&lt;/p&gt;
&lt;p&gt;&lt;span class="lead"&gt;Music:&lt;/span&gt; John Doe  (&lt;a href="../../mid/d/u/m/m/dummy.mid" title="Listen to music, MIDI format"&gt;🔊&lt;/a&gt; &lt;a href="../../pdf/en/d/u/m/m/Dummy.pdf" title="Download score, PDF format"&gt;pdf&lt;/a&gt; &lt;a href="../../nwc/d/u/m/m/Dummy.nwc" title="Download score, Noteworthy Composer format"&gt;nwc&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;

&lt;p&gt;This page is used to test glo­bal search-and-replace us­ing re­gu­lar ex­pressions. &lt;/p&gt;

&lt;section class="lyrics"&gt;
&lt;div class="stanzas"&gt;&lt;div class="lyrics-text mc ll"&gt;
&lt;p&gt;Mary had a little lambkin,&lt;br&gt;
Its fleece was white as snow.&lt;br&gt;
And everywhere that Mary went,&lt;br&gt;
The lamb was sure to go.&lt;br&gt;
He followed her to school one day,&lt;br&gt;
That was against the rule.&lt;br&gt;
It made the children laugh and play&lt;br&gt;
To see a lamb at school.&lt;/p&gt;
&lt;p&gt;And so the teacher turned him out,&lt;br&gt;
But still he lingered near,&lt;br&gt;
And waited patiently about&lt;br&gt;
Till Mary did appear.&lt;br&gt;
And then he ran to her, and laid&lt;br&gt;
His head upon her arm,&lt;br&gt;
As if he said &lt;q&gt;I’m not afraid,&lt;br&gt;
You’ll keep me from all harm.&lt;/q&gt;&lt;/p&gt;
&lt;p&gt;&lt;q&gt;What makes the lamb love Mary so?&lt;/q&gt;&lt;br&gt;
The eager children cry.&lt;br&gt;
&lt;q&gt;‘Oh, Mary loves the lamb, you know,&lt;/q&gt;&lt;br&gt;
The teacher did reply.&lt;br&gt;
&lt;q&gt;And you each gentle animal&lt;br&gt;
In confidence may bind,&lt;br&gt;
And make them follow at your call,&lt;br&gt;
If you are always kind.&lt;/q&gt; &lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;/section&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p dir="auto">It sounds like your comment addresses that. Am I correct?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92678</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92678</guid><dc:creator><![CDATA[Sylvester Bullitt]]></dc:creator><pubDate>Mon, 05 Feb 2024 21:11:35 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 21:08:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sylvester-bullitt" aria-label="Profile: Sylvester-Bullitt">@<bdi>Sylvester-Bullitt</bdi></a> said in <a href="/post/92671">Find-in-FIles: Can’t Replace Multiple Instances of Word</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> I love it when a plan comes together!</p>
<p dir="auto">Will let you know how testing goes “in the wild” (i.e., on actual files).</p>
</blockquote>
<p dir="auto">Here’s the problem file:</p>
<pre><code>&lt;!DOCTYPE HTML&gt;
&lt;html lang="en-us"&gt;

&lt;head&gt;
&lt;meta charset="utf-8"&gt;
&lt;title&gt;Mary Had a Little Lamb&lt;/title&gt;
&lt;meta name="description" content="Words: Sarah Hale, 1830. Music: None."&gt;
&lt;meta name="keywords" content="Sarah Hale"&gt;
&lt;link rel="stylesheet" href="../../css/hymn.css"&gt;
&lt;script src="../../js/jquery.js"&gt;&lt;/script&gt;
&lt;script src="../../js/base.js"&gt;&lt;/script&gt;
&lt;script src="../../js/hymn.js"&gt;&lt;/script&gt;
&lt;link rel="prev" href="../../htm/h/e/w/o/hewonsav.htm"&gt;
&lt;link rel="next" href="../../htm/h/e/s/a/hesallwo.htm"&gt;
&lt;link rel="up" href="../../ttl/ttl-h.htm"&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;section id="preface"&gt;
&lt;h1 class="screen-reader-only"&gt;Introduction&lt;/h1&gt;
&lt;div class="preface-text"&gt;
&lt;p&gt;&lt;span class="lead"&gt;Words:&lt;/span&gt; &lt;a href="../../bio/h/a/l/e/hale_sjb.htm"&gt;Sarah J. Hale&lt;/a&gt;, 1830.&lt;/p&gt;
&lt;p&gt;&lt;span class="lead"&gt;Music:&lt;/span&gt; John Doe  (&lt;a href="../../mid/d/u/m/m/dummy.mid" title="Listen to music, MIDI format"&gt;🔊&lt;/a&gt; &lt;a href="../../pdf/en/d/u/m/m/Dummy.pdf" title="Download score, PDF format"&gt;pdf&lt;/a&gt; &lt;a href="../../nwc/d/u/m/m/Dummy.nwc" title="Download score, Noteworthy Composer format"&gt;nwc&lt;/a&gt;).&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;

&lt;p&gt;This page is used to test glo­bal search-and-replace us­ing re­gu­lar ex­pressions. &lt;/p&gt;

&lt;section class="lyrics"&gt;
&lt;div class="stanzas"&gt;&lt;div class="lyrics-text mc ll"&gt;
&lt;p&gt;Mary had a little lambkin,&lt;br&gt;
Its fleece was white as snow.&lt;br&gt;
And everywhere that Mary went,&lt;br&gt;
The lamb was sure to go.&lt;br&gt;
He followed her to school one day,&lt;br&gt;
That was against the rule.&lt;br&gt;
It made the children laugh and play&lt;br&gt;
To see a lamb at school.&lt;/p&gt;
&lt;p&gt;And so the teacher turned him out,&lt;br&gt;
But still he lingered near,&lt;br&gt;
And waited patiently about&lt;br&gt;
Till Mary did appear.&lt;br&gt;
And then he ran to her, and laid&lt;br&gt;
His head upon her arm,&lt;br&gt;
As if he said &lt;q&gt;I’m not afraid,&lt;br&gt;
You’ll keep me from all harm.&lt;/q&gt;&lt;/p&gt;
&lt;p&gt;&lt;q&gt;What makes the lamb love Mary so?&lt;/q&gt;&lt;br&gt;
The eager children cry.&lt;br&gt;
&lt;q&gt;‘Oh, Mary loves the lamb, you know,&lt;/q&gt;&lt;br&gt;
The teacher did reply.&lt;br&gt;
&lt;q&gt;And you each gentle animal&lt;br&gt;
In confidence may bind,&lt;br&gt;
And make them follow at your call,&lt;br&gt;
If you are always kind.&lt;/q&gt; &lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;/section&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p dir="auto">When I searched for <strong>lamb</strong>, it found the expected instances in the lyrics section (class = “lyrics-text”), but surprisingly, it also found <strong>Lamb</strong> in the &lt;title&gt;. But the regex, as I originally wrote it, said it should only find matches <strong>after</strong> the string lyrics-text.</p>
<p dir="auto">Did adding <strong>/G</strong> change the behavior I think you mentioned that it might make subsequent searches start at the beginning of the file.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92677</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92677</guid><dc:creator><![CDATA[Sylvester Bullitt]]></dc:creator><pubDate>Mon, 05 Feb 2024 21:08:13 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 21:07:22 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> said in <a href="/post/92672">Find-in-FIles: Can’t Replace Multiple Instances of Word</a>:</p>
<blockquote>
<p dir="auto">To prevent \G from matching the start, you need to make sure the first alternative consumes the \A: FIND = (?s)(\A.*?lyrics-text|\G).+?(?&lt;!^)(?&lt;!&lt;p&gt;)(?&lt;!&lt;p class=“chorus”&gt;)\Kstar(?=(.+?&lt;/div&gt;))<br />
With that, it only finds and replaces 2 in your “Twinkle Twinkle” file, instead of 3.</p>
</blockquote>
<p dir="auto">It might not matter in <a class="plugin-mentions-user plugin-mentions-a" href="/user/sylvester-bullitt" aria-label="Profile: Sylvester-Bullitt">@<bdi>Sylvester-Bullitt</bdi></a>’s application, but it should be noted that if the file does not contain the text <strong><code>lyrics-text</code></strong> at all, the expression given will replace every occurrence of <strong><code>star</code></strong>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92676</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92676</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Mon, 05 Feb 2024 21:07:22 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 21:02:14 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> Peter, I’m unfamiliar with the syntax <strong>(?:lyrics-text|\G)</strong>. It resembles a lookbehind, but all the lookbehinds I’ve seen look like <strong>(? &lt;=a)</strong> (i.e., no colon). What exactly is this thing? Where is it documented?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92675</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92675</guid><dc:creator><![CDATA[Sylvester Bullitt]]></dc:creator><pubDate>Mon, 05 Feb 2024 21:02:14 GMT</pubDate></item><item><title><![CDATA[Reply to Find-in-FIles: Can’t Replace Multiple Instances of Word on Mon, 05 Feb 2024 20:58:45 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> said in <a href="/post/92672">Find-in-FIles: Can’t Replace Multiple Instances of Word</a>:</p>
<blockquote>
<p dir="auto">This isn’t 100% clear in the User Manual,</p>
</blockquote>
<p dir="auto">I have tweaked the UM to include the phrase from the boost manual, to make it more clear.  It is doubtful anything I write, especially regarding regular expressions, can be 100% clear. ;-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/92674</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/92674</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 05 Feb 2024 20:58:45 GMT</pubDate></item></channel></rss>