Update repacement expression to handle links with anchors