I want to be able to extract an email address embedded in tags e.g. <email> [email protected] </email>
where the src is as <email>[email protected]</email>
My expression I use is as follows: (?<=email>).*(?=<)/i)
.
This works well. However, if the email is a hyperlink i.e. <email>**<a href="mailto:[email protected]" target="_blank"**>[email protected]</a> </email>
then i can no longer extract the extact email address. i get the following:
<a href="mailto:[email protected]">[email protected]</a>
instead of [email protected]
. I have tried (?<=a href="mailto:).*(?="target="_blank")/i)
but nothing is returned.
Any ideas on how to extract the email when the hyperlink is there?