Advice: try it. You probably have by now. It's a bit too general. 00/00/0000 will return a true match, so will 99/99/9999. However, they're obviously not correct dates. You also don't need the square brackets around the forward slashes--escape them instead (or in the case of the code below, accept any character to delimit the date).
Code:- /^(0[1-9]{1}|[12]{1}[0-9]{1}|3[01]{1}).{1}(0[1-9]{1}|1[0-2]{1}).{1}([12]{1}[0-9]{3})$/
Copy Code This will accept 01-10-2009, 01/10/2009, or any other delimit character chosen. If you want it to be exactly the forward slash, replace the two parts where it's written .{1} with \/
Just beware: If you plan to verify dates before the 11th century or after the 30th century, you'll need to modify it.  |