title: replace with regexp return undefined
body: <p>I'm not so bad in regular expression but there I have a tiny problem, maybe one of you can answer this simple question.</p>
  
  <p>I do this:</p>
  
  <pre><code>var myString = "10px";
  var myRegexp = new RegExp("(\\d*\\.?\\d*){1}(em|ex|grad|ch|deg|ms|rad|rem|s|turn|vh|vw|vmin|vmax|px|cm|in|pt|pc|%)?", "gi");
  
  myString.replace(myRegexp, function( match, number, type ){
      console.log(match, number, type);
  });
  </code></pre>
  
  <p>The replace console log two time, the first is : <code>"10px", "10", "px"</code> and I don't know why there is a second time, it return me that: <code>,,undefined</code> (the two first value are not null or empty string, they return just nothing, absolutely empty).</p>
  
  <p>My question, why the replace try a seconde replacing on nothing ? And how avoid it ?</p>