title: Why is RegEx ignoring the second match if immediately following the first?
body: <p>I have a string: <code>'4 0 13 0 0 30 32 0 14 9 27 0 27 20 4 0 22 0'</code>. The value I want my RegEx to find is contained within a variable named <code>targetValue</code>. 
  In this case <code>targetValue</code> happens to equal <code>0</code> and I want all matches to be replaced with bolder text. Here is the basic code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function startReplacing(){
    var targetValue = 0;
    var replacer = ' &lt;b&gt; ' + targetValue + ' &lt;/b&gt; ';
    var re = new RegExp('\\s'+targetValue+'\\s','gi');
  
    var str = document.getElementById('string').innerHTML;
    str = str.replace(re, replacer);
  
    document.getElementById('string').innerHTML = str;
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>b{ font-size:125% }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p id="string"&gt; 4 0 13 0 0 30 32 0 14 9 27 0 27 20 4 0 22 0 &lt;/p&gt;
  &lt;button onclick="startReplacing()"&gt;REPLACE&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>After clicking "REPLACE" Do you notice the <em>"0"</em> before the value <em>"30"</em>? My RegEx <em>missed</em> this value. How can I change my code to fix this?</p>
  
  <p>Note: My RegEx Misses <strong>all</strong> values that should match immediately following a first match.</p>