multiple pattern regular expression

micron_make micro_passion at
Fri Apr 25 14:30:18 CEST 2008

I am trying to parse a file whose contents are :


for a single line I used 
for line in file:

is there a way to match multiple patterns using regex and return a
dictionary. What I am looking for is (pseudo code)

for line in file:"pattern1" OR "pattern2" OR ..,line)

and the result should be {pattern1:match, pattern2:match...}

Also should I be using regex at all here ?


View this message in context:
Sent from the Python - python-list mailing list archive at

More information about the Python-list mailing list