title: Regular expression with asterisk quantifier
body: <p>This <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions" rel="nofollow">documentation</a> states this about the asterisk quantifier:</p>
  
  <blockquote>
    <p>Matches the preceding character 0 or more times.</p>
  </blockquote>
  
  <p>It works in something like this:</p>
  
  <pre class="lang-javascript prettyprint-override"><code>var regex = /&lt;[A-Za-z][A-Za-z0-9]*&gt;/;
  var str = "&lt;html&gt;";
  console.log(str.match(regex));
  </code></pre>
  
  <p>The result of the above is : <code>&lt;html&gt;</code></p>
  
  <p>But when tried on the following code to get all the "r"s in the string below, it only returns the first "r". Why is this?</p>
  
  <pre><code>var regex = /r*/;
  var str = "rodriguez";
  console.log(str.match(regex));
  </code></pre>
  
  <p>Why, in the first example does it cause "the preceding" character/token to be repeated "0 or more times" but not in the second example?</p>