A vote for re scanner

Wade Leftwich wade at lightlink.com
Wed Nov 12 22:04:36 CET 2003


tweedgeezer at hotmail.com (Jeremy Fincher) wrote in message news:<698f09f8.0311101455.41f8706a at posting.google.com>...
> wade at lightlink.com (Wade Leftwich) wrote in message news:<5b4785ee.0311100714.1445cdfb at posting.google.com>...
> > Every couple of months I have a use for the experimental 'scanner'
> > object in the re module, and when I do, as I did this morning, it's
> > really handy. So if anyone is counting votes for making it a standard
> > part of the module, here's my vote:
> 
> While I don't think they're still accepting votes :), you've pointed
> me to something I didn't know about until now.  What kinds of things
> have you been using re.Scanner for?
> 
> Jeremy

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.




More information about the Python-list mailing list