How does one extract a date from a string using javascript? It can be in the following formats:
31.07.2014
07.31.2014
2014.07.31 the same format but divi
RegEX will help you to extract date with Different Type of format and It returns as Array,
let str="dd/mm/yyyy06/06/2018 yyyy/mm/dd 2018/02/12 d/m/yy 1/1/18 dd/mm/yy 18/12/12 mm/d/yyyy 12/2/2018 m/dd/yyyy 1/12/2018 yy/m/d 18/1/1 yy/mm/d 18/12/1 yyyy/2018/1/1";
str.match(/(\d{1,4}([.\-/])\d{1,2}([.\-/])\d{1,4})/g);
Reference Link From regextester