title: javascript string replace function with regex where I can insert a variable
body: <p>I have this code:</p>
  
  <pre><code>$(this).html(html.replace(/"expedita"/gi, '&lt;strong&gt;$&amp;&lt;/strong&gt;'));
  </code></pre>
  
  <p>which is working but the string to replace is hardcoded, I need to be able to insert a variable</p>
  
  <pre><code>$(this).html(html.replace(/"+search+"/gi, '&lt;strong&gt;$&amp;&lt;/strong&gt;'));
  </code></pre>
  
  <p>search is a variable I have assigned a value I want to replace, but this code is not working, it seems i can't insert a variable into regex expression. </p>
  
  <p>How can I use regex but not have a hardcoded word and be able to use any word?</p>