regular expression i'm going crazy

Tracubik affdfsdfdsfsd at b.com
Mon May 16 12:25:00 EDT 2011


pls help me fixing this:

import re
s = "linka la baba"
re_s = re.compile(r'(link|l)a' , re.IGNORECASE)

print re_s.findall(s)

output: 
['link', 'l']

why?
i want my re_s to find linka and la, he just find link and l and forget 
about the ending a.

can anyone help me? trying the regular expression in redemo.py (program 
provided with python to explore the use of regular expression) i get what 
i want, so i guess re_s is ok, but it still fail...
why?
help!

Nico



More information about the Python-list mailing list