PHP preg_replace: Replace all anchor tags in text with their href value with Regex
问题 I want to replace all anchor tags within a text with their href value, but my pattern does not work right. $str = 'This is a text with multiple anchor tags. This is the first one: <a href="https://www.link1.com/" title="Link 1">Link 1</a> and this one the second: <a href="https://www.link2.com/" title="Link 2">Link 2</a> after that a lot of other text. And here the 3rd one: <a href="https://www.link3.com/" title="Link 3">Link 3</a> Some other text.'; $test = preg_replace("/<a\s.+href=['|\"]([