我需要验证日期格式,可以是11/11/11
or 11/22/2013
,即年份块可以是YY
or YYYY
,完整格式将是MM/DD/YY
orMM/DD/YYYY
我有这个代码
^(\d{1,2})\/(\d{1,2})\/(\d{4})$
我试过了
^(\d{1,2})\/(\d{1,2})\/(\d{2}{4})$ // doesn't works, does nothing
和
^(\d{1,2})\/(\d{1,2})\/(\d{2|4})$ // and it returns null every time
PS:我正在使用 Javascript/jQuery 应用它