Welcome to WebmasterWorld Guest from 220.127.116.11
I thought I was proficcient in PHP until I came across regex.
In short, I have tonnes of HTML which I need to extract "href" links from complete with anchor text (if applicable).
I need a preg_match_all function regex that can give me an array of 1) The entire HTML <A> tag (e.g. <a href='http:\\www.example.com'>Example link</a> 2) Just the URL (full URL, not just domain) and 3) Anchor text
I've only seen a few suggested expressions, all of which havent worked on searches.
The regex needs to be able to take care of <a> tag anomalies where the <a is separated from the 'href' through 'onclick's etc.