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

  • 2020-03-26 23:03:57
  • OfStack

Var STR ="sfsfsfdf2011 ";

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

The match method gives you an array


Related articles: