Neil Cerutti wrote: > A found some clues on lexing using the re module in Python in an > article by Martin LĂ·wis.
> Here, each alternative in the regular expression defines a > named group. Scanning proceeds in the following steps: > > 1. Given the complete input, match the regular expression > with the beginning of the input. > 2. Find out which alternative matched. you can use lastgroup, or lastindex: http://effbot.org/zone/xml-scanner.htm there's also a "hidden" ready-made scanner class inside the SRE module that works pretty well for simple cases; see: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/457664 </F>
-- http://mail.python.org/mailman/listinfo/python-list