Does anyone know a regex function in PHP to strip an anchor of its contents, only if the anchor's href attribute contains specific text?
For example, I have an HTML page and there are links throughout. But I want to strip only the anchors that contain "yahoo" in the URL. So <a href="http://pages.yahoo.com/page1">Example page</a>
would become: Example, while other anchors in the HTML not containing "yahoo" would be left alone.