But I need to write a function that takes in a string, looks for a URL in a hyperlink and then swaps the url around so that the page name is now used as an anchor so for example
<a href="mysection/mysector/apage.aspx">
would become
<a href="mysection/mysector.aspx#apage">
but this would only happen for links in the mysector folder.
I am a bit stumped at the moment and any help would be great.