A vote for re scanner

Fredrik Lundh fredrik at pythonware.com
Sat Nov 15 18:45:08 EST 2003


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

</F>








More information about the Python-list mailing list