Regular expression for validating date format mmddyyyy dansk dating Albertslund

: # day-check: non caturing group # days 01-28 0[1-9]|1\d|[2][0-8]| # february 29d check for leap year: all 4y / 00 years: only each 400 # 0400,0800,1200,1600,2000,... :0[1-9]|1[012]) # year 0000-9999 .\d $ # end anchor /^(?

x) # modifier x: free spacing mode (for comments) # verify date dd/mm/yyyy; possible separators: -.,/ # valid year range: 0000-9999 ^ # start anchor # precheck xx-xx-xxxx,...

It won't be validated, but you won't know why.

Maybe because of invalid format (not conforming to YYYY-MM-DD), maybe because of an invalid value (2015-02-31). The OP's question was not about value validation, but of format validation.

([0-9](([2468][048]|[02468][48])|[13579][26])|([13579][26]|[02468][048]|0[0-9]|1[0-6])00))$ ^([0-9][-/]?

(0[1-9]|1[0-9]|2[0-8]))|([0-9](([2468][048]|[02468][48])|[13579][26])|([13579][26]|[02468][048]|0[0-9]|1[0-6])00)[-/]?

Leave a Reply