A vote for re scanner

Alex Martelli aleaxit at yahoo.com
Sun Nov 16 13:01:03 CET 2003

Fredrik Lundh wrote:

> Alex Martelli wrote:
>> Wade Leftwich wrote:
>>    ...
>> > A scanner is constructed from a regex object and a string to be
>> > scanned. Each call to the scanner's search() method returns the next
>> > match object of the regex on the string. So to work on a string that
>> > has multiple matches, it's the bee's roller skates.
>> ...if that method's name was 'next' (and an appropriate __iter__
>> also present) it might be even cooler, though...
> re.finditer

Yep.  So the scanner isn't warranted any longer, right?


More information about the Python-list mailing list