Don't use regex to parse html or xml. Use a parser.
wheaties
2010-09-22 01:46:05
If you are looking for a solution with the fastest execution speed XmlReader is one of the fastest XML parser. It is a bit harder to use, then other solution such as DOM, but since you want to parse a lot of entry, performance is probably important.
Otherwise DOM is pretty simple to use. You can find a simple example of how to use in this answer I gave on an other question.
If you want to load up your content as a string here's how you do it :
XMLReader
$foo = new XMLReader();
$foo->xml($yourStringHere);
DOMDocument
$foo = new DOMDocument();
$foo->loadHTML($yourStringHere);