this regex is able to validate a date (format dd.mm.yyyy) in every state of user typing. i use it to ensure that the user isn't able to type in an invalid date at all (except from a leap year check which is done afterwards)
The regex also makes assumptions of 'missed' separators so 1234 is captured in groups which can then be transformed to \1.\2.\3 -> 12.3.4
It was intensively but not exhaustivly tested