title: Javascript - Replace only if there is a perfect match
body: <p>I am currently studying javascript and I stumbled upon this problem. Is there a way I can specify to replace the words only if there is a perfect match? </p>
  
  <p>PS: I thought that 'g' will fix the problem but it only did it half-way.</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>var text = "Isabella is moving to New York in March";
  var words = ["is","in"];
  var combine = new RegExp(words.join("|"),"g");
  
  text = text.replace(combine,"REPLACE");
  console.log(text);</code></pre>
  </div>
  </div>
  </p>