title: How Can I Get Data From HTML Source Code with PHP and RegEx?
body: <p>I have got HTML source code, and i must get some information text in the HTML. I can not use DOM, because the document isn't well-formed. </p>
  
  <p>Maybe, the source could change later, I can not be aware of this situation. So, the solution of this problem must be advisible for most situation. </p>
  
  <p>Im getting source with curl, and i will edit it with preg_match_all function and regular expressions.</p>
  
  <p>Source : 
  <br />
  ...<br />
  <code>&lt;TR Class="Head1"&gt;</code>
  <br />
  <code>&lt;TD width="15%"&gt;&lt;font size="12"&gt;Name&lt;/font&gt;&lt;/TD&gt;</code>
  <br />
  <code>&lt;TD&gt;:&amp;nbsp;&lt;/TD&gt;</code>
  <br />
  <code>&lt;TD align="center"&gt;&lt;font color="red"&gt;Alex&lt;/font&gt;&lt;/TD&gt;</code>
  <br />
  <code>&lt;TD width="25%"&gt;&lt;b&gt;Job&lt;/b&gt;&lt;/TD&gt;</code>
  <br />
  <code>&lt;TD&gt;:&amp;nbsp;&lt;/B&gt;&lt;/TD&gt;</code>
  <br />
  <code>&lt;TD align="center" width="25%"&gt;&lt;font color="red"&gt;Doctor&lt;/font&gt;&lt;/TD&gt;</code>
  <br />
  <code>&lt;/TR&gt;</code>
  <br />
  ...
  <br />
  ...
  <br />
  <code>&lt;TR Class="Head2"&gt;</code>
  <br />
  <code>&lt;TD width="15%" align="left"&gt;Age&lt;/B&gt;&lt;/TD&gt;</code>
  <br />
  <code>&lt;TD&gt;:&amp;nbsp;&lt;/TD&gt;</code>
  <br />
  <code>&lt;TD align="center"&gt;&lt;font color="red"&gt;32&lt;/font&gt;&lt;/TD&gt;</code>
  <br />
  <code>&lt;TD width="15%"&gt;&lt;font size="10"&gt;data&lt;/TD&gt;&lt;/font&gt;</code>
  <br />
  <code>&lt;TD&gt;&amp;nbsp;&lt;/B&gt;&lt;/TD&gt;</code>
  <br />
  <code>&lt;TD width="40%"&gt;&amp;nbsp;&lt;/TD&gt;</code>
  <br />
  <code>&lt;/TR&gt;</code>
  <br/>
  ...
  <br /></p>
  
  <p>As we have seen, the source is not well-formed. In fact, terrible! But there is nothing I can do.
  The source is longer than this.</p>
  
  <p>How can I get the data from the source? I can delete all of HTML codes, but how can i know sequence of data? What can I do with preg_match_all and regex? What else can I do?</p>
  
  <p>Im waiting for your help.</p>