tag:blogger.com,1999:blog-60805297092265133.post3625009949010557150..comments2024-03-28T20:18:07.835+11:00Comments on Sean Xiong: JAVA: use regex to validate date and time.Anonymoushttp://www.blogger.com/profile/10172798807828346691noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-60805297092265133.post-91589960803557616352012-09-21T12:38:58.498+10:002012-09-21T12:38:58.498+10:00u r right.
regex is quite useful too, especiall w...u r right. <br />regex is quite useful too, especiall when you are working in both java and js. <br /><br />I just want to post the right regex for date and time here. Anonymoushttps://www.blogger.com/profile/10172798807828346691noreply@blogger.comtag:blogger.com,1999:blog-60805297092265133.post-36494646216261489112012-09-20T07:56:07.833+10:002012-09-20T07:56:07.833+10:00It is better to use DateFormat to parse and valida...It is better to use DateFormat to parse and validate the date string rather than use regex to validate it. Since regex is not easy to read and maintain and your method cannot even detect some invalid case such as "31/02/2000" which does not exist. Anonymoushttps://www.blogger.com/profile/15058885244787299574noreply@blogger.com