RE: [PHP] another REGEX question
| From: | Julian Simpson | Date: | Thu, 02 Aug 2001 21:39:00 +0000 |
| Subject: | RE: [PHP] another REGEX question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-60999@lists.php.net to get a copy of this message | ||
hahah that had two interesting effects the first was that it left the < > and the second
was that it turned off all the highlighting in my editor due to the "?>"
any idea how to include the braces in the match and perhaps not using the ?> string
for the sake of convenience :)
Julian
8/2/01 5:19:03 PM, "Jack Dempsey" <dabigdemp@hotmail.com> wrote:
>Try
>$str = preg_replace("<p.*?>", " ",$str);
>
>jack
>
>-----Original Message-----
>From: Julian Simpson [mailto:frithj@home.com]
>Sent: Thursday, August 02, 2001 5:16 PM
>To: php-general@lists.php.net
>Subject: [PHP] another REGEX question
>
>I have a string can look like either of the following:
><p>some stuff</p>
><p align = "left">some stuff</p>
>
>I want to use eregi_replace to take out the first p tag whether it be
><p> or <p align......> with a space
>
>I assumed that $str = eregi_replace ("<p.*>", " ",$str);
>but it matches the entire string and thus turns the whole string into
>one space.
>aparently regex will match the biggest possible match rather than the
>smallest
>my question is how do i get it to match the smallest.
>
>thanx in advance..
>
>Julian
>
>
>--
>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
>
>