Whats a good way to check a date format, i want the format to be 2011-12-08 16:59:18 I have boost would using regex be the best way to go or is there some C++ way of doing it. Thanks in advance. here are some test conditions but not limited to these.
So for example someone enters
2011-2-08 16:59:18 //incorrect date month needs to have 2 digits 02
2011-02-08 16:9:18 //incorrect minuets needs to have 2 digits 09
2011-02-0X 16:09:18 //incorect alpha character for day no alpha except - and :
2011-12-08 16:59:18 // correct
Regular expressions would work, or you could just walk the string and test each character to be sure it is what you expect it to be. You will probably spend less time doing the latter.