title: Jquery replace a specific character combination
body: <p>I can't figure out why my jquery replacement code wouldn't work.</p>
  
  <p>I try to make the follow replacement:</p>
  
  <pre><code>http://mysite.com/_thumbs/0000312/0312718/0312718_$varm.jpg
  </code></pre>
  
  <p>I added '$var' to the position where I want to put a number, we can take '1' for now.
  So I need to replace $var for 1.</p>
  
  <p>What I tried;</p>
  
  <pre><code> var img = $('img', this).attr('src'); // I grabs the image url like above.
   img.replace(/$var/, 1)
  </code></pre>
  
  <p>But nothing happens.</p>
  
  <p>Thanks in advance!</p>
  
  <p>Nick</p>