Extract the function code for the day month and year in the string


Var STR =“sfsfsfdf2011 ”;

STR. Match (/ \ d {4} years [01]? \ [0123] d month? \ d/g) [0];

The match method gives you an array