You have missed a parenthesis and add an extra one at the end:
^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[[12][0-9]|3[01])T(0[0-9]|1[0-9]|2[0123]??):(0[0-9]|[12345][0-9]):(0[0-9]|[12345][0-9])$
// add parenthesis here __^ and delete the one here __^
You may also simplify to:
^(19|20)\d\d-(0[1-9]|1[012])-([012]\d|3[01])T([01]\d|2[0-3]):([0-5]\d):([0-5]\d)$
Another way to go to test only the format then test the validity is:
^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)$
and then test the validity:
- group1 between 1900 and 2000
- group2 between 01 and 12
- group3 between 01 and 31
- group4 between 00 and 23
- group5 between 00 and 59
- group6 between 00 and 59
Or, better, use a date parser;, I'm there is one that exists in your favorite language.