2010/11/2 Yingjie Lan <lany...@yahoo.com>:
>> From: John Bond <li...@asd-group.com>
>> Subject: Re: Why this result with the re module
> ...
> I suggested findall return a tuple of re.MatchObject(s),
> with each MatchObject instance representing a match.
> This is consistent with the re.match() function anyway.
> And it will eliminate the need of returning tuples,
> and it is much more precise and information rich.
>
>
Hi,
in that case you may use re.finditer(...), which seem to provide, what
you need here. (It returns an iterator over the Match objects, which
can be easily fed to tuple(...) if it were needed.)

hth,
  vbr
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to