Advertisement
simeonshopov

Match Dates

Feb 20th, 2020
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. import re
  2.  
  3. text = input()
  4.  
  5. matches = re.finditer('\\b(?P<day>\\d{2})([-./])(?P<month>[A-Z][a-z]{2})\\2(?P<year>\\d{4})\\b', text)
  6.  
  7. for match in matches:
  8.     print(f"Day: {match.group('day')}, Month: {match.group('month')}, Year: {match.group('year')}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement