$re = '~(0[1-9]|[12][0-9]|3[01])/(0[1-9]|1[012])/(19|20)[0-9]{2}~m';
$str = '-- não aceita mais esses casos
99/99/9999
00/00/0000
-- mas ainda aceita datas inválidas
31/04/2019 -- abril só tem 30 dias
29/02/2019 -- 2019 não é ano bissexto, então 29/02 é inválido';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php