Okay I have this
var URL = \"http://stackoverflow.com/questions/10767815/remove-everything-before-the-last-occurrence-of-a-character\"; console.log(URL.subst
Try an array based extraction like
var URL = "http://stackoverflow.com/questions/10767815/remove-everything-before-the-last-occurrence-of-a-character"; snippet.log(URL.split('/').slice(0, 5).join('/'));