I want to extract "stringtoextract" below I can't see why it doesn't work: https://jsfiddle.net/dwbnj6z7/
let url = 'https://mystuff.com/test/varstring/stringtoextract?id=test3'
let regex = /https:\/\/stuff.com\/test\/varstring\/.+\/(.+)?.+/
var match = regex.exec(url);
alert(match[1]);