Re: regex
| From: | Robin Vickery | Date: | Thu, 14 Sep 2000 14:51:44 +0000 |
| Subject: | Re: regex | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16784@lists.php.net to get a copy of this message | ||
robin@planet-three.co.uk (Robin Vickery) writes:
> monte@ispi.net (Monte Ohrt) writes:
> >
> > Alan Morey wrote:
> > >
> > > i'm using
> > >
> > > eregi("<[^>]*>", $string) to match all html tags how can i get it
> > > to ignore
> > > php tag <? ... ?> ?
> > >
> >
> > eregi("<[^?][^>]*>", $string)
> >
>
> <?php if ($foo == $bar && $baz == $wibble) { print "Wow! Coincidence or
> what?"; } ?>
<?php if ($foo < $bar && $baz > $wibble) { print "Wow! Coincidence or
what?"; } ?>
Can't believe I did that, sorry...
>
> If you're allowing arbitrary php code in your string, bear in mind that your
> regex will match things like the '< $bar && $baz >' in this snippet.
>
> -robin
--
Robin Vickery...............................................
Planet-Three, 3A West Point, Warple Way, London, W3 0RG, UK
Email: robin@planet-three.net Phone: +44 (0)870 729 5444