Re: regular expressions
| From: | (Philip Hallstrom) | Date: | Sun, 04 Jun 2000 19:15:37 +0000 |
| Subject: | Re: regular expressions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-989@lists.php.net to get a copy of this message | ||
Take a look at the strip_tags function. It will remove all HTML tags
(and php tags) from a string... so then you'd end up with just a normal
string of text and could do what you want with it...
-philip
>Hi there,
> I want to detect certain words in a sentence, but I want to avoid =
>the same words if they appear inside a tag (meaning I want to detect =
>only those in the text the user sees).
>I tried this pattern but none worked well.
>For example:
>
><div align=3D'left'>this is the word test link to <a =
>href=3D'http://www.test.com'>test</a>
></div>";
>
>How do I manage to detect *only* the first and the third instants of =
>the word TEST in the above example?
>Thanks,
>David.