0

How can add a condition in this code that it detect only date in between 1-31 and moth in between 1-12

import re
string = input("Enter a string: ")
pattern = re.compile(r'\d\d.\d\d.\d\d\d\d')
matches = pattern.findall(string)
for match in matches:
    print(match)
  • 3
    Possible duplicate of [Regex to validate date format dd/mm/yyyy](https://stackoverflow.com/questions/15491894/regex-to-validate-date-format-dd-mm-yyyy) – Kostas Charitidis Oct 08 '19 at 11:18
  • Possible duplicate of [Validate an ISO-8601 datetime string in Python?](https://stackoverflow.com/questions/41129921/validate-an-iso-8601-datetime-string-in-python) – stovfl Oct 08 '19 at 11:59

0 Answers0