Q:

Convert string date to date object Java

I am trying to convert my string date: 'Saturday 19th May' to the date object. I have looked at other examples and tried to use SimpleDateFormat. The method I have at the moment is: 
     DateFormat format = new SimpleDateFormat("EE/dd/MM" , Locale.ENGLISH);

However, I get this error when trying to format it. 
     java.text.ParseException: Unparseable date: "Saturday 19th May" 
           (at offset 8)

Does anyone know the correct way to format this String? 
Thanks. 

A:

You can try something like this:
String str = "Saturday 17th March 2018";
DateFormat format = new SimpleDateFormat("EEE dd MMM yyyy" , Locale.ENGLISH);

System.out.println(format.parse(str.replaceAll("(?<=\\d)(st|nd|rd|th)", "")));

