I want to extract the date/time pattern from a String.
For example, there are three Strings:
1: "current date: 01/05/2017."
2: "The start date was 15.11.2016."
3: "Christmas (24.12) was on saturday.
The first information that I need is the pattern:
1: "MM/dd/yyyy"
2: "dd.MM.yyyy"
3: "dd.MM"
The second information is the extracted date part:
1: "01/05/2017"
2: "15.11.2016"
3: "24.12"
... or the position of the first value of this result.
All possible patterns are known in advance.
I have no idea how I can realize this in an elegant and performant way.