title: Using Javascripts Regexp to replace string part based on variable
body: <p>I have the following snippet where I try to replace on variable values with javascripts Regexp. But I can not figure out how should look to work</p>
  
  <pre><code>var str = 'display = 12;14&amp;test =124;562'; 
  var str2 = 'display';
  new_values = '123;185';
  var new_str = str.replace(new RegExp( str2 + '/=^[0-9];[0-9]'),  new_values )
  console.log(new_str);
  </code></pre>
  
  <p><a href="http://jsfiddle.net/2b4xx/2/" rel="nofollow">http://jsfiddle.net/2b4xx/2/</a></p>