note 33298 deleted from function.preg-match-all by sniper

From: Date: Tue, 30 Sep 2003 12:23:42 +0000
Subject: note 33298 deleted from function.preg-match-all by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-57442@lists.php.net to get a copy of this message
Note Submitter: Charles ---- preg_match_all doesn't recognize overlapped pattern. For example, $string = "KKEKDONKPTK"; $pattern = "/[KR][^P]/"; preg_match_all($pattern, $string,$output, PREG_OFFSET_CAPTURE | PREG_PATTERN_ORDER); print_r(output); output start positions of every pattern: 0 3 However it doesn't output position 1 (KKE). Is there any way to make an position array for overlapped pattern? Thanks in advance.

« previous php.notes (#57442) next »