Have an URL of type:
https://example.com/some/text/1,2,3,5
Need to replace the 1,2,3,5 part with some different parameters like 2,4,6.
Can do it in code by saving the first part of the URL example.com/some/text/ in the data property but that seems messy so. I'd like to do it through REGeX or via similar method so that don't have to save partial URL anywhere.
window.location.href.slice(0, endOfConstantTextPosition) + variableOfNewStuff