I would like to know if there is a easy way to extract the first encountered date from a String in Java.
My program will analyse a lot of String texts, in different languages. These Strings can contain a date. Because of the languages (and the different sources), I have an awful lot of formats to take into consideration.
I first thought about Regex, making one regex for each format I could find... But there are an awful lot, for exemple "Month (d)d, yyyy" or "mm/dd/yyyy" or "dd-mon-yyyy"...
So I wanted to know if there is an easier way to extract date from a String maybe by using DateFormat
, so I can convert the found date to "dd/mm/yyyy".
Thank you for your help. ^^