Home >Web Front-end >JS Tutorial >Function code to extract year, month and day from string_Basic knowledge
var str="sfsfsfdf2011 sfsdfsf05 comes with the CD on lfs23rd";
str.match(/d{4}year[01]?dmonth[0123]?d day/g)[0];
The match method gets an array