http://activity.m.duibatest.com.cn/projectx/p79f6420d/index.html

var _href = "http://activity.m.duibatest.com.cn/projectx/p79f6420d/index.html";
var sd=_href.replace(new RegExp("\\S*projectx\\W(\\S+)\\Windex.html","g"),$1);
console.log(sd);

//var regular="(\\S+)//(\\S+)projectx/(\\S+)/index.html";
var projectId=window.location.href.replace(new RegExp("(\\S+)//(\\S+)projectx/(\\S+)/index.html","g"),"$3")
console.log(projectId)