note 69523 deleted from function.preg-match by colder
| From: | colder@php.net | Date: | Mon, 18 Jun 2007 18:33:10 +0000 |
| Subject: | note 69523 deleted from function.preg-match by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127635@lists.php.net to get a copy of this message | ||
Note Submitter: Eric Vautier
----
Was stumped for a little while trying to match a word, but exclude the same word if part of a
specific expression.
For example: match "media" but not "windows media" or "quicktime
media".
What needed to be used in my case is the following:
<?php
/(?<!windows|quicktime)\smedia/
?>
? - check
< - look left
! - exclude
windows|quicktime - the list of words to exclude
\s - white space
media - word to match