Write a program using regular expressions that will check if the input date is valid. A valid date in this case is an actual date in the format DD/MM/YYYY. However, for now, let's make some assumptions to make the task easier and say that a day is a digit from 01 to 31 (regardless of the month); a month is a digit from 01 to 12; and a year should be between 1000 and 2999. Print True if a date is valid, and False otherwise.
Regexps in programs
Date format validation
Report a typo
Sample Input 1:
01/12/2018Sample Output 1:
TrueWrite a program in Python 3
import re
string = input()
# your code here
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.