I have a script that search a mail body.
in the mail body a get a list of ID's like below: Batch: yt166161 Section:567-947 Sys_id: 1234 Sys_id: 6543 Sys_id: 0974
I need to extract only the number after the Sys_id: and put the in an array.
I'm working on JavaScript
You can use the regex /[0-9]+/gm to extract the number.
ex:
const str = 'Sys_id: 1234 Sys_id: 6543 Sys_id: 0974';
const regex = /[0-9]+/gm;
const matches = str.match(regex);
console.log(matches);
output:
[ "1234" , "6543" , "0974" ]