How to write in a Pythonic way when there are multiple regex patterns to test with and extract matched groups if a test succeeds?
That is to say, what is the Pythonic equivalent of the following code snippet?
if re.match(pattern1, string):
m = re.match(pattern1, string)
grps = m.groups()
...[process matched groups for pattern1]...
elif re.match(pattern2, string):
m = re.match(pattern2, string)
grps = m.groups()
...[process matched groups for pattern2]...
elif re.match(pattern3, string):
m = re.match(pattern3, string)
grps = m.groups()
...[process matched groups for pattern3]...