I'd like some help please. I'm having am input field where I'd like to check if the user has entered his date of birth in these formats: dd/mm/yyyy
or dd-mm-yyyy
if(preg_match('/^[0-9]{2}-[0-9]{2}-[0-9]{4}$/', $_POST['dob'])){
// ok
} else {
// there's an error
}
How can I change my regular expression to match either the '/'
or '-'
between the numbers?