regex extract meeting id from zoom link

I have an array of zoom links:

[
    "https://studygroup.zoom.us/j/94760481101?pwd=SVhsUnVoTFpUYjJhOE4rSnNVM3MvUT09",
    "https://studygroup.zoom.us/j/97335370546",
]

I want to extract id, which expected results are:

[
    "94760481101",
    "97335370546",
]

Thank you for any suggestion.

Answer

let links = [
    "https://studygroup.zoom.us/j/94760481101?pwd=SVhsUnVoTFpUYjJhOE4rSnNVM3MvUT09",
    "https://studygroup.zoom.us/j/97335370546"
]

let lnk=links.map(l=>l.split('/').pop().split('?').shift());

console.log(lnk);

Leave a Reply

Your email address will not be published. Required fields are marked *