Hi experts,

How would you do this without the more and more indenting cascade of ifs?:

match = my_regex.search(line)
if match:
   doSomething(line)
else:
   match = my_regex2.search(line)
   if match:
     doSomething2(line)
   else:
     match = my_regex3.search(line)
     if match:
       doSomething3(line)

etc.

Thanks in advance and regards,
Ernesto
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to