You can combine it to get 2 overall information blocks.
Incrementally match the form delimiters - - : :
while allowing/matching bad segments.
In the end you get info on the form progress.
And also the form segments.
You test the form's progress via capture groups 2,4,6,8,10
You test the date/time elements via groups 1,3,5,7,9,11
Though, you only need to test the elements up to the maximum group in the form
progress.
^(?:(?:([0-9]{4})|\d*)(-(?:(0[1-9]|1[0-2])|\d*)(-(?:(0[1-9]|[1-2][0-9]|3[0-1])|\d*)([ ]+(?:(2[0-3]|[01][0-9])|\d*)(:(?:([0-5][0-9])|\d*)(:(?:([0-5][0-9])|\d*))?)?)?)?)?)$
Formatted
^
(?:
(?:
( [0-9]{4} ) # (1)
| \d*
)
( # (2 start)
-
(?:
( 0 [1-9] | 1 [0-2] ) # (3)
| \d*
)
( # (4 start)
-
(?:
( 0 [1-9] | [1-2] [0-9] | 3 [0-1] ) # (5)
| \d*
)
( # (6 start)
[ ]+
(?:
( 2 [0-3] | [01] [0-9] ) # (7)
| \d*
)
( # (8 start)
:
(?:
( [0-5] [0-9] ) # (9)
| \d*
)
( # (10 start)
:
(?:
( [0-5] [0-9] ) # (11)
| \d*
)
)? # (10 end)
)? # (8 end)
)? # (6 end)
)? # (4 end)
)? # (2 end)
)
$
segments via if the capture groups matched.