JS: a regular matching date

Time:2021-11-20

(1[0-2]|0?[1-9])[-./](0?[1-9]|[12][0-9]|3[01])[-./](\d\d\d\d) 
$1   matching   10,11,12,01,02,03,04,05,06,07,08,09   It’s also a match   month  
$2   matching   01,02…09,10,11….29,30,31   That is, matching   date  
$3   matching   0000,0001….9999   That is, matching   particular year  
add   Middle character set  
The following will match  
10/10/1999 
10-10-1999 
10.10.1999