const dateRegex = new RegExp('/^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d+$/')
if (!formData.dob || !dateRegex.test(formData.dob)) {
formErrors.dob = "date of birth is required"
}
The RegExp I am using for the date of birth isn't working. Can someone help me with this, please?