Create a method whose parameters are a regular expression to catch the date format and the string that you will be extracting the date from. I believe if you don't have a format that will be used then it won't be possible to extract the date from a series of alphanumeric characters in a string.