Use a regular expression to extract data from a string:
Enter a date in the format mm/dd/yyyy or mm-dd-yyyy:

The date you entered was: