Advertisement
Guest User

Untitled

a guest
Oct 28th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. if m:= re.match(pattern_1, s):
  2. do_stuff_1()
  3. elif m:= re.match(pattern_2, s):
  4. do_stuff_2()
  5. elif m:= re.match(pattern_3, s):
  6. do_stuff_3()
  7. else:
  8. print("No valid matches!")
  9.  
  10.  
  11.  
  12. m = re.match(pattern_1, s)
  13. if m:
  14. do_stuff_1()
  15. else:
  16. m = re.match(pattern_2, s)
  17. if m:
  18. do_stuff_2()
  19. else:
  20. m = re.match(pattern_3)
  21. if m:
  22. do_stuff_3()
  23. else:
  24. print("No valid matches!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement