title: Javascript str.replace with variables
body: <p>I have found a short script which finds a line with a certain phrase in it and replaces the whole line with a new line. However I can't work out how to include a variable where it says '#RemoveMe' in the str.replace. (I want to include the variable 'start' which is passed in by the function's trigger, to make --> (/^.<em>start.</em>$/mg, ""))</p>
  
  <p>Any help appreciated...</p>
  
  <pre><code>        var str = 'line1\n'+
            'line2\n'+
            '#RemoveMe line3\n'+
            'line4';
  
          var test = str.replace(/^.*#RemoveMe.*$/mg, "");
  </code></pre>
  
  <p>Thanks.</p>