I am trying to figure out how to extract a date from a string using a user defined pattern. The pattern could read many different ways, such as: Y-m-d, d/m/Y, (m/d/Y), [d/m/Y], etc...
The string that contains the parsed date in it, is a regular block of text, and is parsed using the defined pattern (similar to what is described above). For example, the dates inside the string would look something like the following, depending on the user-defined pattern: 2014-04-25, 04/25/2014, 25/04/2014, (04/25/2014), [25/04/2014], etc.
Is there a way to use the user-defined pattern to extract the actual date from a string? I would hope some sort of regex could do the job, but so far I am a stuck on this issue.
Yis\d{4}.one fits allregex in this case, due to the confusion between month and day, ex: 04/04/2014 and 04/04/2014 which one is the day or month ?04/04it is not very important to know that! :)