regular expression for (NOT 'word')
| From: | Ando Saabas | Date: | Thu, 14 Mar 2002 15:32:50 +0000 |
| Subject: | regular expression for (NOT 'word') | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-88521@lists.php.net to get a copy of this message | ||
how would i build a regular expression in php that would match
everything but the given word. For example, match the string only if
there isnt a word 'php' in the string.
I understand i can list characters i dont want to see in the string:
[^php].
but this means there cant be any p or h in the string. And ^(php) checks
if the string starts with 'php'.
How should i do it?