Save Item as a regular expression with javascripts

Hi I have an issue on to extract its value and save it to the regular expression.

Extract the value from the date of the mail and apply it to java

“Peter will be onboarding on 16/09/2021” ------> var id=Body.match(/(Employee Number: []+)/gmi);

Right now i couldnt find a code to extract the value from the mail date.

Thank you


You can use the below code in Javascript to fetch date in javascript:

var str=“Peter will be onboarding on 16/09/2021”;
var one = str.match(/(\d{1,4}([.-/])\d{1,2}([.-/])\d{1,4})/g);

After extracting the date, you can pass the same to next step for further process.