DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Regular Expression To Match MySQL's DATETIME Type
Matches MySQL built-in datetime type, for example, 2007-06-05 15:26:02
It also matches date type, i.e. 2007-06-05
/^([0-9]{2,4})-([0-1][0-9])-([0-3][0-9]) (?:([0-2][0-9]):([0-5][0-9]):([0-5][0-9]))?$/






Comments
Snippets Manager replied on Thu, 2012/01/12 - 2:44am