I am trying to create a regular expression to match a string holding a date in the MySQL timestamp format, ex “2012-07-16 02:04:33”.
It is not as easy as it sounds, e.g. you should not end up with February 30th.
I know there are easier ways to do this, but I am depending on being able to pass a string and a regular expression to evaluate that string.
I would be glad for any suggestions.
The regular expression:
does the job. Thanks for the input.