validation for date and regexp