Regex, React, JavaScript, Nodejs, Development.
Explanation: This regular expression checks if a date is entered in YYYY–MM–YY format Like 2019–12–18 in the format of 4 digits–2 digits–2 digits function isDateValid(date) { if(/\d{4}-\d{2}-\d{2}/.test(date)) { console.log('date is valid'); } else { console.log('date is invalid') } }