Word boundary regex with RegExp in javascript
<blockquote>
  <p>Owe no one anything to another</p>
</blockquote>

<pre><code>&gt; str.replace(/\bno\b/g, 'yes');
'Owe yes one anything to another'

&gt; str.replace(new RegExp('\bno\b','g'),'yes');
'Owe no one anything to another'
</code></pre>

<p>Why does using RegExp not work in this case? I need to use it so that I can</p>

<pre><code>var regex = new RegExp('\b'+ **myterm** +'\b','g');  or
var regex = new RegExp('(^|\s)'+ **myterm** +'(?=\s|$)','g');
</code></pre>
