title: Replacing strings with regex in JavaScript
body: <p>A particular regular expression is bugging me right now. I simply want to replace the <b>range=100</b> in a string like</p>
  
  <pre><code>var string = '...commonstringblabla&lt;b&gt;&amp;range=100&amp;&lt;/b&gt;stringandsoon...';
  </code></pre>
  
  <p>with </p>
  
  <pre><code>...commonstringblabla&lt;b&gt;&amp;range=400&amp;&lt;/b&gt;stringandsoon...
  </code></pre>
  
  <p>I successfully matched the "range=100"-part with</p>
  
  <blockquote>
    <p>alert( string.match(/range=100/) );</p>
  </blockquote>
  
  <p>But when I try to replace it,</p>
  
  <blockquote>
    <p>string.replace(/range=100/, 'range=400');</p>
  </blockquote>
  
  <p>nothing happens. The string still has the range=100 in it. How can I make it work?</p>