Please see my advice in my comment to the question. However, I don't see where do you have the HTML document downloaded using your URL. It looks like you are trying to do Regex match with the text of URL itself, not the HTML document.
Do download an HTML page by URL using HTTP request, you can use PHP
HttpRequest
:
http://www.php.net/manual/en/class.httprequest.php[
^].
—SA