Regex to extract all window.location occurences from a HTML document using PHP
<p>How to extract all the window.location occurrences in PHP? I am reading a series of URLs using cURL, storing its HTML content as a string and want to match all the window.location occurrences and output them separately. I tried the following but it doesn't seem to work. TIA.</p>

<pre><code>$str = 'window.location = "http://www.example.com";
        window.location.href = "http://www.example.com";
        window.location.assign("http://www.example.com");
        window.location.replace("http://www.example.com");
        self.location = "http://www.example.com";
        top.location = "http://www.example.com";
        ';
preg_match('(window\\.location*)', $str,$result);
print_r($result);
</code></pre>