<p dir="auto">Challenge <a href="https://www.freecodecamp.com/challenges/override-class-declarations-with-inline-styles#?solution=%0A%3Cstyle%3E%0A%20%20body%20%7B%0A%20%20%20%20background-color%3A%20black%3B%0A%20%20%20%20font-family%3A%20Monospace%3B%0A%20%20%20%20%20color%3A%20green%3B%20%7D%0A%20%20.pink-text%20%7Bcolor%3A%20pink%3B%7D%0A%20%20.blue-text%20%7Bcolor%3A%20blue%3B%7D%0A%3C%2Fstyle%3E%0A%3Ch1%20id%3D%22orange-text%22%20class%3D%22pink-text%20blue-text%22%3E%0A%3Ch1%20style%3D%22color%3A%20white%3B%22%3E%0A%20%20Hello%20World!%0A%3C%2Fh1%3E%0A" rel="nofollow">Override Class Declarations with Inline Styles</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36</code>.<br>
Please describe how to reproduce this issue, and include links to screenshots if possible.</p>
<p dir="auto">My code:</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
&lt;style&gt;
  body {
    background-color: black;
    font-family: Monospace;
     color: green; }
  .pink-text {color: pink;}
  .blue-text {color: blue;}
&lt;/style&gt;
&lt;h1 id=&quot;orange-text&quot; class=&quot;pink-text blue-text&quot;&gt;
&lt;h1 style=&quot;color: white;&quot;&gt;
  Hello World!
&lt;/h1&gt;
"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">style</span><span class="pl-kos">&gt;</span>
  <span class="pl-ent">body</span> {
    <span class="pl-c1">background-color</span><span class="pl-kos">:</span> black;
    <span class="pl-c1">font-family</span><span class="pl-kos">:</span> Monospace;
     <span class="pl-c1">color</span><span class="pl-kos">:</span> green; }
  .<span class="pl-c1">pink-text</span> {<span class="pl-c1">color</span><span class="pl-kos">:</span> pink;}
  .<span class="pl-c1">blue-text</span> {<span class="pl-c1">color</span><span class="pl-kos">:</span> blue;}
<span class="pl-kos">&lt;/</span><span class="pl-ent">style</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;</span><span class="pl-ent">h1</span> <span class="pl-c1">id</span>="<span class="pl-s">orange-text</span>" <span class="pl-c1">class</span>="<span class="pl-s">pink-text blue-text</span>"<span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;</span><span class="pl-ent">h1</span> <span class="pl-c1">style</span>="<span class="pl-s">color: white;</span>"<span class="pl-kos">&gt;</span>
  Hello World!
<span class="pl-kos">&lt;/</span><span class="pl-ent">h1</span><span class="pl-kos">&gt;</span></pre></div>
<h4 dir="auto">Challenge Name</h4>
<p dir="auto">Sift through Text with Regular Expressions<br>
<a href="https://www.freecodecamp.com/challenges/sift-through-text-with-regular-expressions" rel="nofollow">https://www.freecodecamp.com/challenges/sift-through-text-with-regular-expressions</a></p>
<h4 dir="auto">Issue Description</h4>
<p dir="auto">The instructions clearly state</p>
<blockquote>
<p dir="auto">Select all the occurrences of the <strong>word</strong> <em>and</em> in <em>testString</em>.</p>
</blockquote>
<p dir="auto">Hence i think the following regex <code class="notranslate">/\band\b/gi</code> or <code class="notranslate">/(?:\b)and(?:\b)/gi</code> where one actually considers the word boundaries in the expression should also be a valid answer, not just <code class="notranslate">/and/gi</code>.</p>
<p dir="auto">Sorry if this a duplicate (and it probably is), but definitely should be fixed IMHO. Could turn down some dedicated beginners.</p>
<h4 dir="auto">Code</h4>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var expression = /\band\b/gi;
var andCount = testString.match(expression).length;"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">expression</span> <span class="pl-c1">=</span> <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\b</span>and<span class="pl-cce">\b</span><span class="pl-c1">/</span>gi</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">andCount</span> <span class="pl-c1">=</span> <span class="pl-s1">testString</span><span class="pl-kos">.</span><span class="pl-en">match</span><span class="pl-kos">(</span><span class="pl-s1">expression</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">;</span></pre></div>