我發現了一個正則表達式來驗證此日期格式:YYYY/MM/DD HH:MM:SS AM/PM正則表達式
^(?= \ d)(:(?!(?: 1582(:?|。 - | /)10(:|?? - | /)(?: 0 [5-9] | 1 [0-4]))|?(:1752( ?:| - | /)0 9(:|???? - | /)(?: 0 [3-9] | 1 [0-3])))(=(:(?000 [04] | 00))((:(?: 1 [^ 0-6] | | [2468] [^ 048] [3579] [^ 26]):(:\ d \ d)(???? :[02468] [048] | [13579] [26]))\ D0 2 \ D29)|(:???!?\ d {4} \ d((?: 0 [2469] | 11)\ D31 )(??0 2(:|? - | /)?(?:29 | 30))))(\ d {4})([ - /])(0 \ d | 1 [012] )\ 2((00?!)[012] \ d | 3 [01])?(?:?$ |(= \ X20 \ d)???\ X20))((:(?: 0 [1 -9] | 1 [012])(:: [0-5] \ d){0,2}(:\ X20 [AAPP] [MM]))|(:???[01] \ d | 2 [0-3])(?:: [0-5] \ d){1,2})?$
如何更改上述表達式以驗證此格式:mm/dd/yyyy hh:mm :ss A M/PM ???
沒有它的工作適合您嗎? –