How to avoid Object is possibly null in VSCode though code runs ok
let url = 'https://test.com/test/varstring/stringtoextract?id=test3'
let regex = /https:\/\/test.com\/test\/varstring\/.+\/(.+)?.+/
var match = regex.exec(url);
alert(match[1]);