Regexp for xhtml compliant matching
| From: | Klaus Guenther | Date: | Wed, 03 Dec 2003 16:26:56 +0000 |
| Subject: | Regexp for xhtml compliant matching | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-24089@lists.php.net to get a copy of this message | ||
Hi all,
I've come to the end of my rope looking for a nice regexp that matches xhtml
compliant code. I'm trying to match the content of the body tag, so that
HTML_Page can properly parse a document. Don't know exactly how to do it.
That is, it's easy to match the following:
<html>
<head>
<title />
</head>
<body>
<p>some content</p>
</body>
</html>
But... add an embeded html document, and it's not so easy:
<html>
<head>
<title />
</head>
<body>
<p>some content</p>
<!-- embedded documents are possible, -->
<!-- though still rather uncommon -->
<html>
<head><title /></head>
<body><p>some content</p></body>
</html>
</body>
</html>
Any ideas?
TIA,
Klaus