Re: Regular Expression
| From: | [-^-!-%- | Date: | Fri, 04 Jan 2002 03:30:07 +0000 |
| Subject: | Re: Regular Expression | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-79424@lists.php.net to get a copy of this message | ||
I apologize for the repeats. As I mentionned before, I've been having
problems with this list. I believe everything is working fine, now.
-john
On Thu, 3 Jan 2002, Jim Lucas [php] wrote:
> I have seen this question reposted for the past week. now why don't you
> just work with the entire thing.
>
> get the "<body ... >"
>
> now once you have that, do this
>
> $str = preg_replace("<body", "", $str)
> $str = preg_replace(">", "", $str)
>
> now your $str var will only have the properties.
>
> Jim
> ----- Original Message -----
> From: "[-^-!-%-" <monfort@engineering.sdsu.edu>
> To: <php-general@lists.php.net>
> Sent: Wednesday, January 02, 2002 12:45 PM
> Subject: [PHP] Regular Expression
>
>
> >
> > Hello everyone!
> >
> > I'm trying to get the text inside the <BODY> tag, using regular
> > expression.
> >
> > $area = eregi('(<body)(.*)<">)',$str);
> >
> > Where $str is the string containing
> > <body bgcolor="#999999" tex="#..." ...>
> >
> > When I print $area, the string contains the entire content of $str. I
> > get something like:
> >
> > <body ...>
> > <p>
> > .
> > .
> > .
> > </body>
> > </html>
> >
> >
> >
> > __________John Monfort_________________
> > _+-----------------------------------+_
> > P E P I E D E S I G N S
> > www.pepiedesigns.com
> > "The world is waiting, are you ready?"
> > -+___________________________________+-
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
> >
>