title: Extract contents out of a website's HTML source using regex
body: <p>I have the following code that I'm trying to get fixed.</p>
  
  <p>The code:</p>
  
  <pre><code>$pageData = file_get_contents('111234-2.html');
  if(preg_match_all('/&lt;a\s+onclick=["\']([^"\']+)["\']/i', $pageData, $links, PREG_PATTERN_ORDER))
       print_r(array_unique($links[1]));
  return false;
  </code></pre>
  
  <p>Some sample HTML where I want it to fetch from:</p>
  
  <pre><code>    &lt;a onclick="doShowCHys=1;ShowWindowN(0,'http://www.example.com/home/Player.aspx?lpk4=116031&amp;amp;playChapter=False',960,540,111234);return false;" href="javascript:void(0);"&gt;
  &lt;span class="vt"&gt;Welcome
  
          &lt;/span&gt;
          &lt;span class="dur"&gt;1m 10s&lt;/span&gt;
          &lt;span class="" id="bkmimgview-116031"&gt;&amp;nbsp;&lt;/span&gt;
          &lt;br class="clear"&gt;
      &lt;/a&gt;
  </code></pre>
  
  <p>The output I am getting:</p>
  
  <pre><code>Array ( [0] =&gt; doShowCHys=1;ShowWindowN(0, )
  </code></pre>
  
  <p>The output I am hoping for:</p>
  
  <pre><code>Array ( [0] =&gt; doShowCHys=1;ShowWindowN(0,'http://www.example.com/home/Player.aspx?lpk4=116031&amp;amp;playChapter=False',960,540,111234);return false;)
  </code></pre>
  
  <p>How do I achieve this?</p>