The problem is that you indicate that the end of the line ($) should follow immediately after the year. If you remove this condition, you can get the date from the string. In addition, you catch the components separately, so you will not get the date as a single line. In addition, you need to avoid periods if you want them to correspond only to periods, otherwise they will match any character:
^([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{4,4})
or simply:
^(\d{1,2}\.\d{1,2}\.\d{4})
Guffa source share