Re: Is re.findall guaranteed to be in order?

2008-07-16 Thread Fredrik Lundh
Joshua Kugler wrote: Experimenting has shown me that re.findall() will return a list with the matches in the order it found them. in the order it found them doesn't really say much, does it? ;-) findall and finditer both scans the string from left to right, and will return matches in that

Re: Is re.findall guaranteed to be in order?

2008-07-16 Thread Joshua Kugler
Fredrik Lundh wrote: Joshua Kugler wrote: Experimenting has shown me that re.findall() will return a list with the matches in the order it found them. in the order it found them doesn't really say much, does it? ;-) findall and finditer both scans the string from left to right, and

Is re.findall guaranteed to be in order?

2008-07-15 Thread Joshua Kugler
I tried looking through re.py and sre_compile.py, but I can't really see an answer to my question. Experimenting has shown me that re.findall() will return a list with the matches in the order it found them. Am I lucky so far, or does the _sre.c's logic dictate the items will be added in order

Re: Is re.findall guaranteed to be in order?

2008-07-15 Thread MRAB
On Jul 15, 11:07 pm, Joshua Kugler [EMAIL PROTECTED] wrote: I tried looking through re.py and sre_compile.py, but I can't really see an answer to my question. Experimenting has shown me that re.findall() will return a list with the matches in the order it found them.  Am I lucky so far, or