I am trying to figure out the proper regex to assert dates in the following format: mm/dd/yy. The date can display single and double digits for the months and days. There is no zero in front of the single digit. So January 1st, 2024 would look like this: 1/1/2024.
Below is what I use for an assertion in Cypress, but when there is a single digit in the month, date or both, it fails. Can anyone tell me what might be the issue?
var dateFormatRegex= /(0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.](19|20)dd/;