I need to check that a string takes on the format
05:31:2008:06:27:2010
I do not have to check anything such as valid date or anything just that there are 2 digits, colon, two digits, colon, four digits…. etc
So my first attempt at this my regex looks like this
[0-9]{2}:[0-9]{2}:[0-9]{4}:[0-9]{2}:[0-9]{2}:[0-9]{4}
It does not seem to work, any help would be appreciated.
or shorter, with grouping and no escaping of
:If that doesn’t work you need to post more code.