I have a dilemma in using regex as I am very new in using this:
I have the URL below:
var url = https://website.com/something-here/page.html?p=null#confirmation?order=123
My expected result is:
/something-here/page.html #confirmation
It could be a space or a comma or simply combine the two(/something-here/page.html#confirmation)
I can do this using two regex below:
var a= url.match(/som([^#]+).html/)[0];
var b= url.match(/#([^#]+).tion/)[0];
console.log(a,b);
But I would like to have it done as a single regex with the same result.