title: jQuery replace with variable?
body: <p>I'm trying to do a <code>replace</code> on a string like this:</p>
  
  <pre><code>$('#example_id').replace(/abc123/g,'something else')
  </code></pre>
  
  <p>But the <code>abc123</code> actually needs to be a variable.</p>
  
  <p>So something like:</p>
  
  <pre><code>var old_string = 'abc123'
  $('#example_id').replace(/old_string/g,'something else')
  </code></pre>
  
  <p>So how would I use a variable in the replace function?</p>