Regex for Date DD-MM-YYYY
- by Josh M
I have the following expression which will be used as date validation in the HTML5 "pattern" attribute.
?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))-(?:(?:0[1-9]|1[0-2])-(?:19|20)[0-9]{2}
I want it to allow only valid dates, using "-" as a separator.
This means up to 29th in February if it's a leap year,…