RE question

Michael Hudson mwh21 at
Tue Apr 18 15:52:27 CEST 2000

Benyang Tang <btang at> writes:

> >>> m = re.match("([abc])+", "abc");
> 'c'
> Why is it 'c', instead of 'a'?


we find:

   If a group is contained in a part of the pattern that matched
   multiple times, the last match is returned.

So that's why.


  nonono,  while we're making wild  conjectures about the behavior 
  of completely  irrelevant tasks,  we must not  also make serious 
  mistakes, or the data might suddenly become statistically valid.
                                      -- Erik Naggum, comp.lang.lisp

More information about the Python-list mailing list