re - multiple results

Pingveno pingveno at comcast.net
Fri Jun 10 23:41:13 CEST 2005


I'm working on the Python Challenge (make sure to try it:
http://www.pythonchallenge.com). One of the puzzles requires the use of
regular expressions, but with multiple matches in the text. I tried to
use re.findall(), but I only go one result instead of a list of results.

>>> print re.findall(r"myexpression",text)
['AZBaCTR']

There should, of course, be several matches. What function should I use?
Or is it not a function issue?

Thanks,
Pingveno



More information about the Python-list mailing list