I'm not sure this is the best place to ask this or not, so apologies in advance if not.
I have the need to extract multiple dates from a string. However, the format of the dates can vary from string to string (the format of the two dates in a single string should be the same) and the text around the dates can vary as well. I have no control of the strings, but they will all be in UK order of day and month. Example strings include, but is not limited to
From 1 March 1960 To 1 March 2235
For a period starting 1/3/1960 and ending 1/3/2235
Starting 1.3.1960 and ending 1.3.2235
My current thinking is to run a number of RegEx's on the string, one for each potential format, with some logic to limit which ones to use (for example, if the string contained '/' I'd run those RegEx variants that use that first).
However, I was hoping that there is a better way to achieve this. I've found out that the environment it will run in may not be able to call web services. So I am looking for a self contained solution if possible.