<?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[With the help of a Regex, how to find &quot;code&quot; preceded by a &quot;&lt;&quot; only if &quot;code {&quot; is absent between &quot;&lt;style&quot; and &quot;&lt;&#x2F;style&gt;&quot; in the css section which is below ?]]></title><description><![CDATA[<p dir="auto">So, the “code” in this should be found:</p>
<pre><code>&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
&lt;/style&gt;
</code></pre>
<p dir="auto">…but not in this:-</p>
<pre><code>&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
code {
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/topic/27601/with-the-help-of-a-regex-how-to-find-code-preceded-by-a-only-if-code-is-absent-between-style-and-style-in-the-css-section-which-is-below</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Jul 2026 08:35:23 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27601.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 08 Jul 2026 20:40:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to With the help of a Regex, how to find &quot;code&quot; preceded by a &quot;&lt;&quot; only if &quot;code {&quot; is absent between &quot;&lt;style&quot; and &quot;&lt;&#x2F;style&gt;&quot; in the css section which is below ? on Fri, 10 Jul 2026 00:16:13 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> Merci beaucoup!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105876</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105876</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Fri, 10 Jul 2026 00:16:13 GMT</pubDate></item><item><title><![CDATA[Reply to With the help of a Regex, how to find &quot;code&quot; preceded by a &quot;&lt;&quot; only if &quot;code {&quot; is absent between &quot;&lt;style&quot; and &quot;&lt;&#x2F;style&gt;&quot; in the css section which is below ? on Thu, 09 Jul 2026 18:54:33 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">I do <strong>not</strong> understand why you think that the following  regex is <strong>OK</strong> !</p>
<p dir="auto"><strong><code>(?s)(&lt;code.*?code\x20\{\s*font-family|&lt;div id="google_translate_element"&gt;&lt;/div&gt;\s*&lt;script.*?&lt;/script&gt;)(*SKIP)(*F)|&lt;code</code></strong></p>
<p dir="auto">Apparently, against the <strong>sample</strong> text, used before and pasted in a <strong>new</strong> tab :</p>
<pre><code class="language-css">&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
code{
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
bla blah
bla blah
bla blah
&lt;style type="text/css"&gt;
code{
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
bla
blah
bla
blah
bla
blah
&lt;style type="text/css"&gt;&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
code {
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;
bla
blah
&lt;code............&gt;............&lt;/code&gt;
A lot of text here, spanning many lines
&lt;style type="text/css"&gt;
code {
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;
Some text/codes here
&lt;div id="google_translate_element"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
Some javascript here
&lt;/script&gt;

MATCH
¯¯|¯¯
  |
  v
&lt;code............&gt;............&lt;/code&gt;
A lot of text here, spanning many lines
&lt;style type="text/css"&gt;
&lt;/style&gt;
Some text/codes here
&lt;div id="google_translate_element"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
Some javascript here
&lt;/script&gt;
</code></pre>
<p dir="auto">It just selects the <strong>last</strong> line beginning with <strong><code>&lt;code</code></strong> !</p>
<hr />
<p dir="auto">However, in a <strong>previous</strong> post, you said :</p>
<blockquote>
<p dir="auto">it should skip what is between <em><code>&lt;div id="google_translate_element"&gt;&lt;/div&gt;\s*&lt;script type="text/javascript"&gt; and &lt;/script&gt;</code></em> …</p>
</blockquote>
<p dir="auto">And, precisely, this <strong>last</strong> line beginning with <strong><code>&lt;code</code></strong>, is, indeed, followed, <strong>further on</strong>, with the block :</p>
<p dir="auto"><strong><code>(?s)&lt;div id="google_translate_element"&gt;&lt;/div&gt;\s*&lt;script type="text/javascript"&gt;.+?&lt;/script&gt;</code></strong></p>
<p dir="auto">Thus, it should <strong>not</strong> have been matched ?!</p>
<hr />
<p dir="auto">Anyway, if this regex <strong>above</strong> seems to work nicely for you, that’s the <strong>main</strong> thing !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105874</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105874</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 09 Jul 2026 18:54:33 GMT</pubDate></item><item><title><![CDATA[Reply to With the help of a Regex, how to find &quot;code&quot; preceded by a &quot;&lt;&quot; only if &quot;code {&quot; is absent between &quot;&lt;style&quot; and &quot;&lt;&#x2F;style&gt;&quot; in the css section which is below ? on Thu, 09 Jul 2026 15:13:51 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 worked for me: <code>(?s)(&lt;code.*?code\x20\{\s*font-family|&lt;div id="google_translate_element"&gt;&lt;/div&gt;\s*&lt;script.*?&lt;/script&gt;)(*SKIP)(*F)|&lt;code</code> - thanks for your time anyway</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105873</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105873</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Thu, 09 Jul 2026 15:13:51 GMT</pubDate></item><item><title><![CDATA[Reply to With the help of a Regex, how to find &quot;code&quot; preceded by a &quot;&lt;&quot; only if &quot;code {&quot; is absent between &quot;&lt;style&quot; and &quot;&lt;&#x2F;style&gt;&quot; in the css section which is below ? on Thu, 09 Jul 2026 13:28:59 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">Your requests are quite <strong>complex</strong>. So I imagined a <strong>completely</strong> different way to solve the different <strong>required</strong> conditions !</p>
<p dir="auto">We’ll add one <strong>special</strong> character, right before any string <strong><code>&lt;code</code></strong>, <strong>beginning</strong> a line, when the conditions are <strong>not</strong> respected</p>
<p dir="auto">Thus, perform, <strong>successively</strong>, these <strong>two</strong> regex replacements :</p>
<p dir="auto">SEARCH <strong><code>(?xs-i) ^ &lt;code (?: (?! &lt;code ). )+? code \x20? {</code></strong></p>
<p dir="auto">REPLACE <strong><code>\x{2588}$0</code></strong></p>
<p dir="auto">We’re searching, here, for the string <strong><code>code\x20?{</code></strong> !</p>
<p dir="auto">And</p>
<p dir="auto">SEARCH <strong><code>(?xs-i) ^ &lt;code (?: (?! &lt;code ). )+? google_translate_element</code></strong></p>
<p dir="auto">REPLACE <strong><code>\x{2588}$0</code></strong></p>
<p dir="auto">We’re searching, here, for the string <strong><code>google_translate_element</code></strong> !</p>
<hr />
<p dir="auto">Now, it’s quite <strong>trivial</strong> : simply search for the regex <strong><code>(?-i)^&lt;code</code></strong> which should be the <strong>allowed</strong> cases, <em>ONLY</em> !</p>
<p dir="auto">If you test it against my <strong>previous</strong> sample text, you should get the following <strong>modified</strong> text :</p>
<pre><code class="language-css">█&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
code{
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
&lt;/style&gt;

█&lt;code............&gt;............&lt;/code&gt;
bla blah
bla blah
bla blah
&lt;style type="text/css"&gt;
code{
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
bla
blah
bla
blah
bla
blah
&lt;style type="text/css"&gt;&lt;/style&gt;

█&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
code {
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;
bla
blah
█&lt;code............&gt;............&lt;/code&gt;
A lot of text here, spanning many lines
&lt;style type="text/css"&gt;
code {
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;
Some text/codes here
&lt;div id="google_translate_element"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
Some javascript here
&lt;/script&gt;

█&lt;code............&gt;............&lt;/code&gt;
A lot of text here, spanning many lines
&lt;style type="text/css"&gt;
&lt;/style&gt;
Some text/codes here
&lt;div id="google_translate_element"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
Some javascript here
&lt;/script&gt;
</code></pre>
<p dir="auto">After <strong>analyzing</strong> your text, simply run this replacement :</p>
<p dir="auto">SEARCH <strong><code>\x{2588}</code></strong></p>
<p dir="auto">REPLACE <strong><code>Leave EMPTY</code></strong></p>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105872</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105872</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 09 Jul 2026 13:28:59 GMT</pubDate></item><item><title><![CDATA[Reply to With the help of a Regex, how to find &quot;code&quot; preceded by a &quot;&lt;&quot; only if &quot;code {&quot; is absent between &quot;&lt;style&quot; and &quot;&lt;&#x2F;style&gt;&quot; in the css section which is below ? on Thu, 09 Jul 2026 12:01:34 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 RegEx doesn’t skip what is between <code>&lt;div id="google_translate_element"&gt;&lt;/div&gt;\s*&lt;script</code> and <code>&lt;/script&gt;</code> (the <code>\s*</code> is to match any number of white spaces in between, even if it is on the next line). Is there any mistake in this RegEx: <code>(?s)(&lt;code.*?code\x20\{\s*font-family|&lt;div id="google_translate_element"&gt;&lt;/div&gt;\s*&lt;script.*?&lt;/script&gt;)(*SKIP)(*F)|&lt;code</code>  ? I think it works.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105871</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105871</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Thu, 09 Jul 2026 12:01:34 GMT</pubDate></item><item><title><![CDATA[Reply to With the help of a Regex, how to find &quot;code&quot; preceded by a &quot;&lt;&quot; only if &quot;code {&quot; is absent between &quot;&lt;style&quot; and &quot;&lt;&#x2F;style&gt;&quot; in the css section which is below ? on Thu, 09 Jul 2026 10:43:17 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…, OK. So I changed my line of reasoning :</p>
<p dir="auto">Instead of looking for zones which do <strong>not</strong> contain the string <strong><code>code\x20?{</code></strong>, I’m looking for sections which <strong>do</strong> contain the string <strong><code>code\x20?{</code></strong></p>
<p dir="auto">Then, using the well-known <em>backtracking control</em> verbs <strong><code>(*SKIP)(*F)</code></strong>, I <strong>omit</strong> these cases and look for the string <strong><code>&lt;code</code></strong>, in all the <strong>other</strong> cases !!</p>
<p dir="auto">Thus, the following <strong>regex</strong> should solve your problem :</p>
<p dir="auto"><strong><code>(?xs-i)  &lt;code  (?:(?!&lt;/style&gt;).)+?  &lt;/code&gt;  (?:(?!&lt;/style&gt;).)+?  &lt;style\x20  (?:(?!&lt;/style&gt;).)*?  code\x20?{  .+?  &lt;/style&gt;  (*SKIP)  (*F)  |  &lt;code</code></strong></p>
<p dir="auto">Test it against the <strong>sample</strong> text, below :</p>
<pre><code class="language-css">&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
code{
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
bla blah
bla blah
bla blah
&lt;style type="text/css"&gt;
code{
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
bla
blah
bla
blah
bla
blah
&lt;style type="text/css"&gt;&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
code {
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;
bla
blah
&lt;code............&gt;............&lt;/code&gt;
A lot of text here, spanning many lines
&lt;style type="text/css"&gt;
code {
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;
Some text/codes here
&lt;div id="google_translate_element"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
Some javascript here
&lt;/script&gt;

&lt;code............&gt;............&lt;/code&gt;
A lot of text here, spanning many lines
&lt;style type="text/css"&gt;
&lt;/style&gt;
Some text/codes here
&lt;div id="google_translate_element"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
Some javascript here
&lt;/script&gt;
</code></pre>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105870</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105870</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 09 Jul 2026 10:43:17 GMT</pubDate></item><item><title><![CDATA[Reply to With the help of a Regex, how to find &quot;code&quot; preceded by a &quot;&lt;&quot; only if &quot;code {&quot; is absent between &quot;&lt;style&quot; and &quot;&lt;&#x2F;style&gt;&quot; in the css section which is below ? on Thu, 09 Jul 2026 10:11:41 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> There is a lot of text between the <code>&lt;code</code> and <code>&lt;style</code> (or more appropriately, between the <code>&lt;/code&gt;</code> and <code>&lt;style</code>) and yes, I want to find just <code>&lt;code</code>. I think you need to introduce a <code>.*?</code> somewhere in the middle of the Regex, to find what is between <code>&lt;code</code> and <code>code\x20\{\s*font-family</code>. The <code>\x20</code> is to match a single white space, the <code>\</code> just before the <code>{</code> is to help escape it and help match the <code>{</code> and the <code>\s*</code> is to match more than one white space, even if they are on the next line or a couple of lines below, as long as everything is a white space.</p>
<p dir="auto">I actually have this block to match the above:-</p>
<pre><code>&lt;code............&gt;............&lt;/code&gt;
A lot of text here, spanning many lines
&lt;style type="text/css"&gt;
code {
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;
Some text/codes here
&lt;div id="google_translate_element"&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
Some javascript here
&lt;/script&gt;
</code></pre>
<p dir="auto">I also want your Regular expression - RegEx - to skip any <code>&lt;code</code> between <code>&lt;div id="google_translate_element"&gt;&lt;/div&gt;\s*&lt;script type="text/javascript"&gt;</code> and <code>&lt;/script&gt;</code> - there are many <code>&lt;script</code> tags and so, it should skip what is between <code>&lt;div id="google_translate_element"&gt;&lt;/div&gt;\s*&lt;script type="text/javascript"&gt;</code> and <code>&lt;/script&gt;</code>  as well as any <code>&lt;code</code> between <code>&lt;/code&gt;</code> and <code>&lt;style</code></p>
<p dir="auto">This RegEx worked but maybe you can improve upon it: <code>(?s)(&lt;code.*?code\x20\{\s*font-family|&lt;div id="google_translate_element"&gt;&lt;/div&gt;\s*&lt;script.*?&lt;/script&gt;)(*SKIP)(*F)|&lt;code</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/105869</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105869</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Thu, 09 Jul 2026 10:11:41 GMT</pubDate></item><item><title><![CDATA[Reply to With the help of a Regex, how to find &quot;code&quot; preceded by a &quot;&lt;&quot; only if &quot;code {&quot; is absent between &quot;&lt;style&quot; and &quot;&lt;&#x2F;style&gt;&quot; in the css section which is below ? on Thu, 09 Jul 2026 08:46:17 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">If I assume that <strong>any</strong> line <strong><code>&lt;style .....&gt;</code></strong> always comes <strong>right after</strong> a line <strong><code>&lt;code....&gt;....&lt;/code&gt;</code></strong>, a possible solution is :</p>
<p dir="auto"><strong><code>(?s-i)&lt;code(?:(?!&lt;/style&gt;).)+?&lt;/code&gt;(?=\R&lt;style (?:(?!code ?{).)*?&lt;/style&gt;)</code></strong></p>
<p dir="auto">Test it against this <strong>sample</strong> text :</p>
<pre><code class="language-css">&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
code {
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
code{
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;&lt;/style&gt;

&lt;code............&gt;............&lt;/code&gt;
&lt;style type="text/css"&gt;
code {
  font-family: &amp;quot;verdana&amp;quot;;
  font-size: 19px;
  color: black;
  font-weight: bold !important;
  line-height: 1 !important;
  }
}
&lt;/style&gt;
</code></pre>
<p dir="auto">As you can see, it select <strong>only</strong> the line <strong><code>&lt;code....&gt;....&lt;/code&gt;</code></strong> when the following section <strong><code>&lt;style .....&lt;/style&gt;</code></strong>, possibly <strong>multi-lines</strong>, does <strong>not</strong> contain any string <strong><code>code {</code></strong> or <strong><code>code{</code></strong> !</p>
<p dir="auto"><strong>Notes</strong> :</p>
<ul>
<li>
<p dir="auto">I do <strong>not</strong> use any <em>Backtracking Control</em> verb</p>
</li>
<li>
<p dir="auto">In the section <strong><code>&lt;code....&lt;/code&gt;</code></strong>, it must <strong>not</strong> contain any string <strong><code>&lt;/style&gt;</code></strong></p>
</li>
<li>
<p dir="auto">In the section <strong><code>&lt;style ....&lt;/style&gt;</code></strong>, it must <strong>not</strong> contain any string <strong><code>code {</code></strong> or <strong><code>code{</code></strong></p>
</li>
</ul>
<hr />
<p dir="auto">If you prefer to look for the string <strong><code>&lt;code</code></strong> <strong>only</strong> and <strong>not</strong> all the zone <strong><code>&lt;code....&gt;....&lt;/code&gt;</code></strong>, use the following regex :</p>
<p dir="auto"><strong><code>(?s-i)&lt;code(?=(?:(?!&lt;/style&gt;).)+?&lt;/code&gt;\R&lt;style (?:(?!code ?{).)*?&lt;/style&gt;)</code></strong></p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105868</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105868</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 09 Jul 2026 08:46:17 GMT</pubDate></item><item><title><![CDATA[Reply to With the help of a Regex, how to find &quot;code&quot; preceded by a &quot;&lt;&quot; only if &quot;code {&quot; is absent between &quot;&lt;style&quot; and &quot;&lt;&#x2F;style&gt;&quot; in the css section which is below ? on Thu, 09 Jul 2026 05:24:37 GMT]]></title><description><![CDATA[<p dir="auto">An alternative Regular expression can be to introduce a negative lookahead between <code>.*?</code> and the <code>code</code> just after it in this Regex: <code>&lt;code.*?code\x20\{\s*font-family</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/105867</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105867</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Thu, 09 Jul 2026 05:24:37 GMT</pubDate></item><item><title><![CDATA[Reply to With the help of a Regex, how to find &quot;code&quot; preceded by a &quot;&lt;&quot; only if &quot;code {&quot; is absent between &quot;&lt;style&quot; and &quot;&lt;&#x2F;style&gt;&quot; in the css section which is below ? on Thu, 09 Jul 2026 04:35:58 GMT]]></title><description><![CDATA[<p dir="auto">I have relied on the explanation of the (*SKIP)(*FAIL) method mentioned at <a href="https://community.notepad-plus-plus.org/topic/26812/generic-regex-how-to-use-the-couple-of-backtracking-control-verbs-skip-fail-or-skip-f-in-regexes/5">https://community.notepad-plus-plus.org/topic/26812/generic-regex-how-to-use-the-couple-of-backtracking-control-verbs-skip-fail-or-skip-f-in-regexes/5</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/105865</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105865</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Thu, 09 Jul 2026 04:35:58 GMT</pubDate></item><item><title><![CDATA[Reply to With the help of a Regex, how to find &quot;code&quot; preceded by a &quot;&lt;&quot; only if &quot;code {&quot; is absent between &quot;&lt;style&quot; and &quot;&lt;&#x2F;style&gt;&quot; in the css section which is below ? on Thu, 09 Jul 2026 04:45:20 GMT]]></title><description><![CDATA[<p dir="auto"><code>(?s)&lt;code.*?code\x20\{\s*font-family(*SKIP)(*F)|&lt;code</code> works but I would like an expert to confirm if it is the best method<br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> or anyone else willing to help, if you have any alternative method also, I am willing to use it, since some of you dislike the (*SKIP)(*F) method</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105864</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105864</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Thu, 09 Jul 2026 04:45:20 GMT</pubDate></item><item><title><![CDATA[Reply to With the help of a Regex, how to find &quot;code&quot; preceded by a &quot;&lt;&quot; only if &quot;code {&quot; is absent between &quot;&lt;style&quot; and &quot;&lt;&#x2F;style&gt;&quot; in the css section which is below ? on Wed, 08 Jul 2026 20:54:41 GMT]]></title><description><![CDATA[<p dir="auto">I tried this Regular expression but it did not help: <code>&lt;code(?!(?:(?!&lt;\/style&gt;)(?s:.) )*&lt;style&gt;)</code> - it matches both (I want it to skip finding the <code>&lt;code......</code> in example 2 since there is a “code” between “&lt;style” and “&lt;/style&gt;”)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105863</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105863</guid><dc:creator><![CDATA[dr ramaanand]]></dc:creator><pubDate>Wed, 08 Jul 2026 20:54:41 GMT</pubDate></item></channel></rss>