Hi, I need to retrieve anchor tag innerHTML using RegExp in php. Consider I have a syntax like

<div class="detailsGray">
<span class="detailEmail">
<a href="http://example.com"class="fontLink">examples@mail.com</a></span>
</div>

here how can we retrieve examples@mail.com using RegExp and preg_match_all(). Thanks

The result will be displayed into an array:

preg_match_all("/([\s]*)([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*([ ]+|)@([ ]+|)([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,}))([\s]*)/i", $syntax, $matches);

echo "<pre>";
print_r($matches);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.