<?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[Match everything except the text and &lt;br&gt; tags]]></title><description><![CDATA[<pre><code>&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;
&lt;p&gt;&lt;span style="font-size:13.5pt"&gt;&lt;span style="font-family:&amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;"&gt;&lt;span style="color:#075296"&gt;Skin lumpy, thick, hard. Excoriations, cracks or fissures. Gluey moisture.&lt;br /&gt;
			&lt;br /&gt;
			Moist, crusty eruptions. Obesity. Sourness. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
			&lt;/div&gt;
&lt;/div&gt;
&lt;div class="container"&gt;
&lt;div class="left"&gt;
</code></pre>
<p dir="auto">This Regular expression failed to find the above:  <code>(?s)&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;\s*&lt;p[^&lt;&gt;]*+&gt;\s*&lt;span[^&lt;&gt;]*+&gt;\s*&lt;span[^&lt;&gt;]*+&gt;\s*&lt;span[^&lt;&gt;]*+&gt;.+?&lt;/span&gt;\s*&lt;/span&gt;\s*&lt;/span&gt;\s*&lt;/p&gt;\s*&lt;/div&gt;/s*&lt;/div&gt;\s*&lt;div class="container"&gt;\s*&lt;div class="left"&gt;</code></p>
]]></description><link>https://community.notepad-plus-plus.org/topic/26369/match-everything-except-the-text-and-br-tags</link><generator>RSS for Node</generator><lastBuildDate>Sun, 07 Jun 2026 07:31:03 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/26369.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 14 Nov 2024 15:02:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Sun, 17 Nov 2024 18:13:01 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> Okay, thank you!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97958</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97958</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Sun, 17 Nov 2024 18:13:01 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Sun, 17 Nov 2024 17:55:10 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/dr-ramaanand" aria-label="Profile: dr-ramaanand">@<bdi>dr-ramaanand</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">In order to use a <strong>valid</strong> <em>INPUT</em> text to do some <strong>tests</strong>, just open the <strong>main</strong> page of our forum. Then hit the <strong><code>Ctrl + U</code></strong> shortcut to open the <strong><code>HTML</code></strong> <strong>source</strong> page of our forum and paste its contents in a <strong>new</strong> tab</p>
<hr />
<p dir="auto">My <strong>generic</strong> regex tries to match the syntax <strong><code>&lt;TAG......</code></strong>, till the <strong>nearest</strong> <strong><code>&gt;</code></strong> character and must be <strong>valid</strong> for any kind of <strong>tag</strong>.</p>
<p dir="auto">Thus, I prefer to insert a <strong>space char</strong> to verify that the tag is a <strong>valid</strong> one . Indeed, this regex will match, either, tags like <strong><code>&lt;head&gt;</code></strong> or for example <strong><code>&lt;span style="color:blue"&gt;blue&lt;/span&gt;</code></strong></p>
<p dir="auto">If you replace the <strong>TAG Name</strong> in the generic regex <strong><code>(?s-i)\A.*?\K&lt;</code>TAG Name<code>(?: .*?)?&gt;</code></strong>, which matches the <strong>first</strong> tag, named <strong>TAG</strong>, in <strong>current</strong> file, you get, from the examples, the regexes :</p>
<ul>
<li>
<p dir="auto"><strong><code>(?s-i)\A.*?\K&lt;head(?: .*?)?&gt;</code></strong></p>
</li>
<li>
<p dir="auto"><strong><code>(?s-i)\A.*?\K&lt;span(?: .*?)?&gt;</code></strong></p>
</li>
</ul>
<p dir="auto">Just test them against the <strong>HTML</strong> code source of our forum</p>
<hr />
<p dir="auto">Now, let’s suppose, for example, that you want to find out the first <strong><code>input ...&gt;</code></strong> tag, <em>AFTER</em> the first <strong><code>img ......&gt;</code></strong> tag, in the <strong><code>HTML</code></strong> code <strong>source</strong> of our forum :</p>
<p dir="auto">Then, from my <strong>previous</strong> post, you would have to use the following regex :</p>
<p dir="auto"><strong><code>(?s-i)\A.*?&lt;img(?: .*?)?&gt;.*?\K&lt;input(?: .*?)?&gt;</code></strong></p>
<p dir="auto">which matches, as <strong>expected</strong>, the following line :</p>
<pre><code class="language-html">&lt;input autocomplete="off" type="text" class="form-control hidden" name="term" placeholder="Search"/&gt;
</code></pre>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
<p dir="auto">P.S. : You also replied in an <strong>old</strong> post, regarding this <strong>extra</strong> <strong><code>space</code></strong> char. However, I’ll <strong>not</strong> reply because this topic is <strong>old</strong> and <strong>not</strong> exactly related to the <strong>present</strong> discussion !</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97957</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97957</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sun, 17 Nov 2024 17:55:10 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Sun, 17 Nov 2024 17:27:27 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> said in <a href="/post/97931">Match everything except the text and &lt;br&gt; tags</a>:</p>
<blockquote>
<p dir="auto">(?s-i)\A.<em>\K&lt;TAG Name(?: .</em>?)?&gt;</p>
</blockquote>
<p dir="auto">I think that that should be <code>(?s-i)\A.*\K&lt;TAG Name(?:.*?)?&gt;</code> with no spaces anywhere in the middle</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97956</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97956</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Sun, 17 Nov 2024 17:27:27 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Sat, 16 Nov 2024 12:15:31 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/dr-ramaanand" aria-label="Profile: dr-ramaanand">@<bdi>dr-ramaanand</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">You said in your <strong>previous</strong> post :</p>
<blockquote>
<p dir="auto">… so I am requesting you to post the last Regular Expression you provided with the sample to be edited with a new heading, “How to find the first occurrence of a tag ?” so that people can search and find it online. Thank you!</p>
</blockquote>
<p dir="auto">But, actually, my regex finds the <strong>first</strong> occurrence of the <strong><code>&lt;div class="left"&gt;</code></strong> tag, <em>AFTER</em> a <strong>first</strong> occurrence of the <strong><code>&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;</code></strong> tag !</p>
<hr />
<p dir="auto">So, to my mind, the <strong>correct</strong> way to match the <strong>first</strong> occurrence of a <strong>specific</strong> tag, in <strong>current</strong> file, is to use the <strong>generic</strong> regex :</p>
<p dir="auto"><strong><code>(?s-i)\A.*?\K&lt;</code>TAG Name<code>(?: .*?)?&gt;</code></strong></p>
<p dir="auto">Just replace the generic <strong>TAG Name</strong> value with a <strong>valid</strong> <strong><code>HTML</code></strong> tag</p>
<p dir="auto">Note that, in case of the <strong>comment</strong> tag, replace the generic <strong>TAG Name</strong>, into the above regex, by the <strong>literal</strong> string <strong><code>!--.*?--</code></strong></p>
<hr />
<p dir="auto">Similarly, the <strong>correct</strong> way to match the <strong>last</strong> occurrence of a <strong>specific</strong> tag, in <strong>current</strong> file, is to use the <strong>generic</strong> regex :</p>
<p dir="auto"><strong><code>(?s-i)\A.*\K&lt;</code>TAG Name<code>(?: .*?)?&gt;</code></strong></p>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97931</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97931</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 16 Nov 2024 12:15:31 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Fri, 15 Nov 2024 04:59:12 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> I am not sure if I am allowed to do it (as the solution was provided by you), so I am requesting you to post the last Regular Expression you provided with the sample to be edited with a new heading, “How to find the first occurrence of a tag ?” so that people can search and find it online. Thank you!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97899</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97899</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Fri, 15 Nov 2024 04:59:12 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Thu, 14 Nov 2024 21:46:41 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/dr-ramaanand" aria-label="Profile: dr-ramaanand">@<bdi>dr-ramaanand</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Again, I did <strong>not</strong> check <strong>all</strong> the possibilities <strong>before</strong> posting. Sorry for the <em>NOISE</em> !</p>
<p dir="auto">So, the <strong>right</strong> regex to use should be :</p>
<p dir="auto"><strong><code>(?s)\A.*?\s*\K&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;\s*.*?\s*&lt;div class="left"&gt;</code></strong></p>
<hr />
<p dir="auto">This time, it will work if you pasted this text, in a <strong>new</strong> tab</p>
<pre><code class="language-html">&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;
&lt;div class="left"&gt;
&lt;div class="left"&gt;
</code></pre>
<p dir="auto">But it will <strong>also</strong> works, if you pasted the following text, in a <strong>new</strong> tab</p>
<pre><code class="language-html">
First non-blank line
second line

Third line before the block to match

&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;
&lt;div class="left"&gt;
&lt;div class="left"&gt;
</code></pre>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97895</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97895</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 14 Nov 2024 21:46:41 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Thu, 14 Nov 2024 21:39:24 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> your last RegEx finds the first occurrence of <code>&lt;div class="left"&gt;</code> even if there is some other text above it. Lovely!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97894</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97894</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Thu, 14 Nov 2024 21:39:24 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Thu, 14 Nov 2024 21:33:21 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> d’accord, merci beaucoup!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97893</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97893</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Thu, 14 Nov 2024 21:33:21 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Thu, 14 Nov 2024 21:27:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dr-ramaanand" aria-label="Profile: dr-ramaanand">@<bdi>dr-ramaanand</bdi></a>,</p>
<p dir="auto">Yes, your regex <strong>does</strong> match the <strong>same</strong> amount of text as my version but my regex seems more <strong>simple</strong> and <strong>logic</strong> !</p>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97892</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97892</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 14 Nov 2024 21:27:12 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Thu, 14 Nov 2024 21:21:56 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> This RegEx: <code>(?s)\A.+?\R\K\s*&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;.+(?=\s*+&lt;div class="left"&gt;)</code> would have stopped searching just before the second occurrence of <code>&lt;div class="left"&gt;</code> if the sample to be searched was like this:-</p>
<pre><code>&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;
&lt;div class="left"&gt;
&lt;div class="left"&gt;
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/97891</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97891</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Thu, 14 Nov 2024 21:21:56 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Thu, 14 Nov 2024 21:21:00 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/dr-ramaanand" aria-label="Profile: dr-ramaanand">@<bdi>dr-ramaanand</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Ah, of course, if you add a <strong><code>&lt;div class="left"&gt;</code></strong> line, <strong>right after</strong> the <strong>first</strong> <strong><code>&lt;div style=".....</code></strong> line, it will <strong>not</strong> work !</p>
<hr />
<p dir="auto">So, given this <em>INPUT</em> text, pasted in a <strong>new</strong> tab:</p>
<pre><code class="language-html">&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;
&lt;div class="left"&gt;
&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:13.5pt;line-height:115%;
    font-family:"Verdana","sans-serif";color:red'&gt;SYNONYMS &lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;div class="left"&gt;
</code></pre>
<p dir="auto">Simply, change the previous <strong>search</strong> regex by this <strong>new</strong> version :</p>
<p dir="auto"><strong><code>(?s)\A.+?\R\s*\K&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;\s*.*?\s*&lt;div class="left"&gt;</code></strong></p>
<p dir="auto">Note the différence : between <strong><code>#EBF4FB;"&gt;\s*</code></strong> and <strong><code>\s*&lt;div class="left"&gt;</code></strong>, I changed the part <strong><code>.+?</code></strong> by <strong><code>.*?</code></strong></p>
<p dir="auto">I also <strong>slightly</strong> change the position of the <strong><code>\K</code></strong> feature</p>
<hr />
<p dir="auto">Ax <strong>expected</strong>, this <strong>new</strong> regex will match the <strong>two consecutive</strong> lines :</p>
<pre><code class="language-html">&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;
&lt;div class="left"&gt;
</code></pre>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97890</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97890</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 14 Nov 2024 21:21:00 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Thu, 14 Nov 2024 20:45:33 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> This RegEx helped stop searching as soon as it found a <code>&lt;p........&gt;</code>:-<br />
<code>(?s)\A.+?\R\K\s*&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;\s*.+?\s*&lt;div class="left"&gt;(?=\s*+&lt;p[^&lt;&gt;]*+&gt;)</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/97889</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97889</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Thu, 14 Nov 2024 20:45:33 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Thu, 14 Nov 2024 20:38:58 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> I used this as a sample:-</p>
<pre><code>&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;
&lt;div class="left"&gt;
&lt;p class=MsoNormal&gt;&lt;b&gt;&lt;span style='font-size:13.5pt;line-height:115%;
    font-family:"Verdana","sans-serif";color:red'&gt;SYNONYMS &lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;div class="left"&gt;
</code></pre>
<p dir="auto">Your Regular expression does not stop searching at the first occurrence of <code>&lt;div class="left"&gt;</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/97888</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97888</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Thu, 14 Nov 2024 20:38:58 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Thu, 14 Nov 2024 17:58:01 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/dr-ramaanand" aria-label="Profile: dr-ramaanand">@<bdi>dr-ramaanand</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">To solve this case, I would use the following <strong>regex</strong> S/R :</p>
<p dir="auto">SEARCH <strong><code>(?s)\A.+?\R\K\s*&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;\s*.+?\s*&lt;div class="left"&gt;</code></strong></p>
<p dir="auto">REPLACE <strong><code>Whatever you want to !</code></strong></p>
<p dir="auto">Note that I did <strong>not</strong> add, this time, the <strong><code>\s*</code></strong> part at the <strong>end</strong> of the <strong>search</strong> regex.</p>
<p dir="auto">Also notice the <strong>two</strong> <strong><code>lazy</code></strong> syntaxes ( <strong><code>.+?</code></strong> ), right <strong>after</strong> <strong><code>\A</code></strong> and right <strong>before</strong> <strong><code>\s*&lt;div class="left"&gt;</code></strong>, in order to select only the <strong>first</strong> section <strong><code>s*&lt;div style=.....\s*&lt;div class="left"&gt;</code></strong>, only !</p>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97887</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97887</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 14 Nov 2024 17:58:01 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Thu, 14 Nov 2024 15:57:37 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> I have more than one <code>&lt;div class="left"&gt;</code>, so how do I make it stop searching after finding the first <code>&lt;div class="left"&gt;</code> ?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97886</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97886</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Thu, 14 Nov 2024 15:57:37 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Thu, 14 Nov 2024 18:08:41 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/dr-ramaanand" aria-label="Profile: dr-ramaanand">@<bdi>dr-ramaanand</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">Ah, I was a bit too <strong>slow</strong> and  <strong>Peter</strong> just beats me ! Note that I used the <strong>same</strong> process than <strong>Peter</strong> to determine where the <strong>error</strong> occurs !</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dr-ramaanand" aria-label="Profile: dr-ramaanand">@<bdi>dr-ramaanand</bdi></a>, you just did a small <strong>typo</strong> error in the regex that you provided !</p>
<hr />
<p dir="auto">The <strong>correct</strong> regex, to match your text, is <strong>not</strong> that one, with a <strong><code>/s*</code></strong> syntax :</p>
<pre><code class="language-diff">                                                                                                                                                                                      V
(?s)&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;\s*&lt;p[^&lt;&gt;]*+&gt;\s*&lt;span[^&lt;&gt;]*+&gt;\s*&lt;span[^&lt;&gt;]*+&gt;\s*&lt;span[^&lt;&gt;]*+&gt;.+?&lt;/span&gt;\s*&lt;/span&gt;\s*&lt;/span&gt;\s*&lt;/p&gt;\s*&lt;/div&gt;/s*&lt;/div&gt;\s*&lt;div class="container"&gt;\s*&lt;div class="left"&gt;
</code></pre>
<p dir="auto">but this one, with a <strong>correct</strong> <strong><code>\s*</code></strong> syntax :</p>
<pre><code class="language-diff">                                                                                                                                                                                      V
(?s)&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;\s*&lt;p[^&lt;&gt;]*+&gt;\s*&lt;span[^&lt;&gt;]*+&gt;\s*&lt;span[^&lt;&gt;]*+&gt;\s*&lt;span[^&lt;&gt;]*+&gt;.+?&lt;/span&gt;\s*&lt;/span&gt;\s*&lt;/span&gt;\s*&lt;/p&gt;\s*&lt;/div&gt;\s*&lt;/div&gt;\s*&lt;div class="container"&gt;\s*&lt;div class="left"&gt;
</code></pre>
<hr />
<p dir="auto"><strong>Remarks</strong> :</p>
<ul>
<li>
<p dir="auto">May be, it would be preferable to add a <strong><code>\s*</code></strong> syntax at the <strong>very end</strong> of your regex !</p>
</li>
<li>
<p dir="auto">You could also simplify this regex, <strong>significantly</strong>, by using the version below :</p>
</li>
</ul>
<p dir="auto">SEARCH <strong><code>(?s)&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;\s*.+?\s*&lt;div class="left"&gt;\s*</code></strong></p>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97885</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97885</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 14 Nov 2024 18:08:41 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Thu, 14 Nov 2024 15:34:07 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 very much. This Regular expression worked: <code>(?s)&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;\s*&lt;p[^&lt;&gt;]*+&gt;\s*&lt;span[^&lt;&gt;]*+&gt;\s*&lt;span[^&lt;&gt;]*+&gt;\s*&lt;span[^&lt;&gt;]*+&gt;.+?&lt;/span&gt;\s*&lt;/span&gt;\s*&lt;/span&gt;\s*&lt;/p&gt;\s*&lt;/div&gt;\s*&lt;/div&gt;\s*&lt;div class="container"&gt;\s*&lt;div class="left"&gt;</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/97883</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97883</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Thu, 14 Nov 2024 15:34:07 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Thu, 14 Nov 2024 15:30:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dr-ramaanand" aria-label="Profile: dr-ramaanand">@<bdi>dr-ramaanand</bdi></a> said in <a href="/post/97877">Match everything except the text and &lt;br&gt; tags</a>:</p>
<blockquote>
<p dir="auto"><code>(?s)&lt;div style="margin-bottom:-15px;width: 100%;background-color:#EBF4FB;"&gt;\s*&lt;p[^&lt;&gt;]*+&gt;\s*&lt;span[^&lt;&gt;]*+&gt;\s*&lt;span[^&lt;&gt;]*+&gt;\s*&lt;span[^&lt;&gt;]*+&gt;.+?&lt;/span&gt;\s*&lt;/span&gt;\s*&lt;/span&gt;\s*&lt;/p&gt;\s*&lt;/div&gt;</code><strong>/s*</strong><code>&lt;/div&gt;\s*&lt;div class="container"&gt;\s*&lt;div class="left"&gt;</code></p>
</blockquote>
<p dir="auto">In this case, your problem is easy.  <code>/s*</code> doesn’t match what you think it matches.  I think you meant <code>\s*</code></p>
<p dir="auto">Do you know how I found this?  I started with a smaller part of your regex, saw that it matched, then slowly added more and more until it didn’t match; then I backed up and found the exact section that caused it to fail, and the solution was easy.  It was simple debugging skills, which you need to learn if you are going to continue to manipulate data using regex.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97881</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97881</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 14 Nov 2024 15:30:33 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Thu, 14 Nov 2024 17:52:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dr-ramaanand" aria-label="Profile: dr-ramaanand">@<bdi>dr-ramaanand</bdi></a> ,</p>
<p dir="auto">Regex is not the best way to edit HTML.  You have been posting HTML-related regex questions for years, and we have tried to communicate this to you over and over again.</p>
<p dir="auto">And even if you decide to choose the wrong tool for the job (which is your perogative), you also haven’t seemed to learn enough about regex to muddle your way through, yourself.  You must put in more effort to learn it yourself, rather than coming back every few months with some slightly different situation than all your others.</p>
<p dir="auto">As you have been told before, but you seem to have forgotten:</p>
<p dir="auto"><em><strong>Please note</strong>: This Community Forum is not a data transformation service; you should not expect to be able to always say “I have data like X and want it to look like Y” and have us do all the work for you.  If you are new to the Forum, and new to regular expressions, we will often give help on the first one or two data-transformation questions, especially if they are well-asked and you show a willingness to learn; and we will point you to the documentation where you can learn how to do the data transformations for yourself in the future.  But if you repeatedly ask us to do your work for you, you will find that the patience of usually-helpful Community members wears thin.  The best way to learn regular expressions is by experimenting with them yourself, and getting a feel for how they work; having us spoon-feed you the answers without you putting in the effort doesn’t help you in the long term and is uninteresting and annoying for us.</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/97880</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97880</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 14 Nov 2024 17:52:14 GMT</pubDate></item><item><title><![CDATA[Reply to Match everything except the text and &lt;br&gt; tags on Thu, 14 Nov 2024 15:23:17 GMT]]></title><description><![CDATA[<p dir="auto">Please tweak my above Regular expression to match (and find) everything except the text and &lt;br&gt; tags. I am trying to replace the above in a couple of (multiple) files</p>
]]></description><link>https://community.notepad-plus-plus.org/post/97879</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/97879</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Thu, 14 Nov 2024 15:23:17 GMT</pubDate></item></channel></rss>