a question on re

eight02645999 at yahoo.com eight02645999 at yahoo.com
Sat Apr 1 01:37:34 EST 2006


hi

i tried to search 2 patterns

pat1 = re.compile("blah")
pat2 = re.compile("blah2")


if i do
if re.findall(pat1,something) and re.findall(pat2,something):
               do something

if does not work

but when i do a nest if,

if re.findall(pat1,something) :
               if re.findall(pat2,something):
                           do something

it works..

please advise on why the first code doesnt work. 
thanks




More information about the Python-list mailing list