<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <br>
    <blockquote cite="mid:333352.24512.qm@web54202.mail.re2.yahoo.com"
      type="cite">
      <pre wrap="">OK, I've got that, and I have no problem with the capturing part.
My real problem is with the number of total matches.
<b>I think it should be 4 matches in total but findall 
gives 6 matches</b>, for the new regex '((.a.)*)*'.
I'd love to know what you think about this.

Many thanks!
Yingjie



      
</pre>
    </blockquote>
    We've already been through that, and nothing's changed - all you've
    done is:<br>
    <br>
    1) taken something that you know (now!) has six matches:<br>
    <br>
    <tt>(.a.)*</tt><br>
    <br>
    2) added an outer capturing group (which does not change the actual
    matches, only what gets returned):<br>
    <br>
    <tt>((.a.)*)</tt><br>
    <br>
    3) then said there must be >=0 occurrences of what's inside it,
    which of course there is, so that has no effect.<br>
    <br>
    <tt>((.a.)*)*</tt><br>
    <br>
    End result: the matching is exactly the same, findall still needs to
    return the 6 things it did in the first place, but now it also has
    to return an extra value at each return location (that being what's
    captured by the new outer group) hence the tuples.<br>
    <br>
    Cheers, JB<br>
  </body>
</html>