Regular Expression Help
| From: | John Monfort | Date: | Wed, 26 Dec 2001 19:08:50 +0000 |
| Subject: | Regular Expression Help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79119@lists.php.net to get a copy of this message | ||
Hello everyone,
I'm using regular expression to extract all text within the <body> tag.
With a BODY tag like
<body bgcolor="" ... text=""> \\only interested in this line.
I use
eregi("( <body ) (.*) (\">) ",$str,$out);
\\spaces included, here, for easy reading.
echo "$out[0]";
However, this prints everything following (and including) the '<BODY'
portion of the BODY tag.
Ex.
<body text=" "...alink="">
<table>....</table>
...
</body>
</html>
I want it to ONLY take the text within the openning body tag. Like,
<body ... >
how do I do this? What am I missing, in the above?
eregi("(<body)(.*)(>)",$str,$out);
-Please help.
-john