JSFiddle - React, Tailwind, and code Playground
by mischah
HTML
<p id="p">
</p>
JavaScript
(function() {
var str = '31.12.2047';
var regexp = /(0[1-9]|[12]\d|3[01])\.(0[1-9]|1[012])\.(19|20)\d{2}/;
var found = str.match(regexp);
console.log(found);
document.getElementById('p').innerHTML = found;
})();