note 33298 added to function.preg-match-all

From: Date: Sat, 21 Jun 2003 17:03:29 +0000
Subject: note 33298 added to function.preg-match-all
Groups: php.notes 
Request: Send a blank email to php-notes+get-50788@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/function.preg-match-all.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33298 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33298&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33298&report=yes

« previous php.notes (#50788) next »