@NewLearner11yeah, that's kind of what I was talking about when I mentioned this:
If you want to take that further then it gets more complex, but theoretically, you can also extract the title or text that accompanies any links on the page.
However, I now realise that I'd misread your request, and thought you purely wanted to extract the URLs, but what you actually want to do is replace their text with the URL link.
Before I look at that, would you consider that potentially replacing that text could make the whole thing not make much sense, and that you might be better off putting the link in a bracket *after* the text that original had the link in it?
So, using your example:
| Past | This has an <a href="www. startpage. com">embedded link</a> in it. |
| Future | This has an embedded link (<a href="www. startpage. com">www. startpage. com</a>) in it. |
For what it's worth, what you're after is essentially parsing, then manipulating HTML, and you'd need to go reasonably deep to accurately win at this on every pass. However if my memory serves correctly I think I might have worked this out for someone else recently. I'll check my solutions, bare with me.
EDIT - OK. LOL ... The best solution might also be the easiest. I'll be back with a separate post in a second, I think, because there's a built in function that does exactly what I just said above. 😅😩😅