jeudi 1 octobre 2015

Need help in finding a regex in Java to capture date with all formats in a string

I have a string with format given below, i want to capture the date from this string and then later parse it with a proper date format.

sometext username, 19/05/1985: some more text
sometext username2, 19-Sep-1985 23:59:59: some more text

Assumptions:

  1. username will always succeeded by a coma ","
  2. A date always ends with a colon
  3. There may more text before and after the username and date strings.

Aucun commentaire:

Enregistrer un commentaire