Hi, I am looking for the Regex expression that will strip the link out of this href tag based on the id that is given. The language does not really matter since (I think) regex is the same for all languages. <a href="http://www.example.com" id="example"> Code (markup): So I only want to get the link "http://www.example.com" if the id of the href is "example" Thanks in advance.
<?php $href = <<<EOF <a href="http://www.example.com" id="example"> EOF; preg_match("/<a href=\"(.*)\" id=\"example\">/", $href, $strip); echo $strip[1]; ?> PHP: