Regular expression for validating date format ddmmyyyy

Posted by / 21-Oct-2017 13:33

Regular expression for validating date format ddmmyyyy

([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)[-/]?

([0-9](([2468][048]|[02468][48])|[13579][26])|([13579][26]|[02468][048]|0[0-9]|1[0-6])00))$ ^(((0[1-9]|[12][0-9]|30)[-/]? :[02468][1-35-79]|[13579][0-13-57-9])00) # 00,04,08,12,... .02)| # d31 positive lookahead: month up to 31 days 31(? :0[13578]|10|12)) ) # eof day-check # month 01-12 .(? :[02468][048]|[13579][26]) ) )| # d30 negative lookahead: february cannot have 30 days 30(?! When I try to validate a date, it will either accept the manual date, or the calendar date but never both. ) (or prevent them from typing anything other than dd/mm/yyyy) ('ve tried regular expressions but it does not accept the value from the calendar) Thanks hopefully!I'm Nataraja Gootooru, programmer by profession and passionate about technologies.

regular expression for validating date format ddmmyyyy-39regular expression for validating date format ddmmyyyy-17regular expression for validating date format ddmmyyyy-34

: # 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,...