title: JavaScript RegExp method exec() returns only one item
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5283071/regex-exec-only-returning-first-match">Regex exec only returning first match</a>  </p>
  </blockquote>
  
  
  
  <pre><code>"a1b2c3d".replace(/[0-9]/g,"x")
  </code></pre>
  
  <p>returns "axbxdxd" as expected.</p>
  
  <pre><code>/[0-9]/g.exec("a1b2c3d")
  </code></pre>
  
  <p>however only returns an array containing one item: ["1"]. Shouldn't it return all matches?</p>
  
  <p>Thanks in advance!</p>