Regex question

Jonas Galvez jg at jonasgalvez.com
Wed Jun 23 02:52:33 EDT 2004


I've a perhaps unusual piece of data to parse with regexes.

>>> import re
>>> re.findall("a (\w ?)*", "a b c d e f g h")
['h']

This is a very very very simplified example. The result I was
expecting is the following: ['a', 'b', 'c'] ... and so forth. Is it
impossible to repeat a pattern group inside another?


Tia,



\\ jonas galvez
// jonasgalvez.com








More information about the Python-list mailing list