Re: A vote for re scanner
From: Alex Martelli (aleaxit_at_yahoo.com)
Date: 11/16/03
- Next message: Ben: "map, filter & reduce..."
- Previous message: Roel Mathys: "Re: Bug or Feature with (overriding) Class Variables?"
- In reply to: Fredrik Lundh: "Re: A vote for re scanner"
- Next in thread: Fredrik Lundh: "Re: A vote for re scanner"
- Reply: Fredrik Lundh: "Re: A vote for re scanner"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 16 Nov 2003 12:01:03 GMT
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?
Alex
- Next message: Ben: "map, filter & reduce..."
- Previous message: Roel Mathys: "Re: Bug or Feature with (overriding) Class Variables?"
- In reply to: Fredrik Lundh: "Re: A vote for re scanner"
- Next in thread: Fredrik Lundh: "Re: A vote for re scanner"
- Reply: Fredrik Lundh: "Re: A vote for re scanner"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|