22 Jul
2009
22 Jul
'09
10:14 p.m.
Jan Kaliszewski
It sounds nice. But why not to use simply:
m = re.match(s, '|'.join(pattern1, pattern2, pattern3, pattern4))
Sorry, I ment of course: m = re.match('|'.join(pattern1, pattern2, pattern3, pattern4), s) ***
"""Do a re.match on string using pattern, returning dict containing groups which could be got by index or by name."""
I ment: "...returning collections.DefaultDict..." (as you can see
in the code following).
Regards,
*j
--
Jan Kaliszewski