<A HREF=results.asp?blah=00000-000-000>00000-000-000</A> How to get anchor text when href contains this text 'results.asp?blah=' and the text after 'blah='
Actually better yet I need a regex that finds a parcel number like 00-00-00-0000-0000-0000 or 00000-000-000
Once you get anchor link use parse_url to get query string (?*). <?php $url = 'http://username:password@hostname/path?arg=value#anchor'; $url = preg_match('/<a href="(.+)">/', $html, $match); $info = parse_url($match[1]); echo $info['query']; ?> PHP: