title: Regexp metachars "*" and "*?" in the JAVA's replaceAll() method behave oddly
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8604286/string-replaceall-anomaly-with-greedy-quantifiers-in-regex">String.replaceAll() anomaly with greedy quantifiers in regex</a><br>
    <a href="https://stackoverflow.com/questions/9228509/strange-behavior-in-regexes">Strange behavior in regexes</a>  </p>
  </blockquote>
  
  
  
  
  
  <p>While</p>
  
  <pre class="lang-java prettyprint-override"><code>"a".replaceAll("a", "b")
  "a".replaceAll("a+", "b")
  "a".replaceAll("a+?", "b")
  </code></pre>
  
  <p>all return <code>b</code>, why does</p>
  
  <pre class="lang-java prettyprint-override"><code>"a".replaceAll("a*", "b")
  </code></pre>
  
  <p>return <code>bb</code> and</p>
  
  <pre class="lang-java prettyprint-override"><code>"a".replaceAll("a*?", "b")
  </code></pre>
  
  <p>return <code>bab</code>?</p>