note 20798 added to function.preg-match
| From: | monte at ispi dot net | Date: | Tue, 16 Apr 2002 16:37:19 +0000 |
| Subject: | note 20798 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-29440@lists.php.net to get a copy of this message | ||
It is possible to do negative lookbehinds with PCRE (perl 5+), but only fixed length.
preg_match('/(?<!AB)C/',$foo,$match);
This will match 'C' only if NOT preceeded by 'AB'. 'AB' must be a
fixed length string, it cannot be an expression.
--
http://www.php.net/manual/en/function.preg-match.php
http://master.php.net/manage/user-notes.php?action=edit+20798
http://master.php.net/manage/user-notes.php?action=delete+20798
http://master.php.net/manage/user-notes.php?action=reject+20798