I'm currently working with Angular 2 and I have a URL link: www.abcd.com/Computers_Accessories/panache-air-pc/P-coac-20620024815-cat-z.html#newId=P-coac-41130779424?trackId=paym&subTrackId=&infitag=1234
My goal is to remove the portion #newId=P-coac-41130779424 from the URL and append it to the end, resulting in the new URL: www.abcd.com/Computers_Accessories/panache-air-pc/P-coac-20620024815-cat-z.html?trackId=paym&subTrackId=&infitag=1234#newId=P-coac-41130779424. I'm wondering if there is a way to use Regex in TypeScript to achieve this or if there is another method that would be more appropriate.