Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if m:= re.match(pattern_1, s):
- do_stuff_1()
- elif m:= re.match(pattern_2, s):
- do_stuff_2()
- elif m:= re.match(pattern_3, s):
- do_stuff_3()
- else:
- print("No valid matches!")
- m = re.match(pattern_1, s)
- if m:
- do_stuff_1()
- else:
- m = re.match(pattern_2, s)
- if m:
- do_stuff_2()
- else:
- m = re.match(pattern_3)
- if m:
- do_stuff_3()
- else:
- print("No valid matches!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement