fecha = document.nombreFormulario.nombreControl.value; patron=/d{2}/d{2}/d{4}/; if (!patron.test(fecha)) alert('Error');