added is_optional boolean param to skip date validation with regex if optional and empty