How do I parse a certain link style out of html without it spreading across multiple links to match?
The exact link I am trying to match is:
href="http://www.hotmail.com' rel='external nofollow"
Pay particular attention to the mismatching of ' and " in the above.
What I have tried:
if(preg_match('|href="http(.*?)\' rel=\'(.*?)"|i', $html)){
echo "Found bad html\n";
}
However that regexp is also matching in perfectly good html across several links. I need to be able to only match within a single link.