const re = new RegExp('(\\d{2}).(\\d{2}).(\\d{4})');
const tests = ['05.05.2020', '05/05/2020', '05/05/2020;22:40', '5', '5.1', '5.23'];
tests.forEach(str => console.log(`${str}: ${re.test(str)}`));
/*
05.05.2020: true
05/05/2020: true
05/05/2020;22:40: true
5: false
5.1: false
5.23: false
*/
ваши «тесты» проходит )