use regex to make sure it is a date code example Example: use regex to make sure it is a date ^[0-3]?[0-9]/[0-3]?[0-9]/(?:[0-9]{2})?[0-9]{2}$