SoFunction
Updated on 2025-03-09

JS: A regular that matches dates

(1[0-2]|0?[1-9])[-./](0?[1-9]|[12][0-9]|3[01])[-./](\d\d\d\d) 
$1 match 10,11,12,01,02,03,04,05,06,07,08,09 is also matched month
$2 Match 01,02...09,10,11...29,30,31 That is, the matching date
$3 Match 0000,0001...9999 That is the match year
Add the middle character collection
The following will match
10/10/1999 
10-10-1999 
10.10.1999