I want to create a simple preg_match to ensure a series of string values are in the following structure :
20191231T16:10:10
So the first are 4 numbers (to represent the year), the next 2 numbers are the month (represented in 01-12 format) & the last 2 numbers are the days (representing in 01-31) along with the 'T' (spacer), the hours (between 00-23), minutes & seconds (between 00-59)
I have the following regex but it doesn't quite work fully.
https://www.phpliveregex.com/p/p0U
^[0-9]{4}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])[A-Za-z](0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])$(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])$