note 68613 added to function.preg-match-all

From: Date: Thu, 03 Aug 2006 13:30:12 +0000
Subject: note 68613 added to function.preg-match-all
Groups: php.notes 
Request: Send a blank email to php-notes+get-115515@lists.php.net to get a copy of this message
Please note that multi-line matches do not work, regardless of the modifiers in php 4.3.x. example: <?php $pattern='/fred(.)+bloggs/iU'; $data="fred hello\nthere bloggs fred goodbye bloggs"; preg_match_all($pattern,$data,$repTxt,PREG_PATTERN_ORDER); print_r($repTxt); ?> Will print out: Array ( [0] => Array ( [0] => fred goodbye bloggs ) [1] => Array ( [0] => ) ) (the \n newline breaks the first match). I just use a loop with strpos to get around this. ---- Server IP: 66.163.161.117 Probable Submitter: 195.11.73.226 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.preg-match-all.php Edit -- https://master.php.net/note/edit/68613 Del: integrated -- https://master.php.net/note/delete/68613/integrated Del: useless -- https://master.php.net/note/delete/68613/useless Del: bad code -- https://master.php.net/note/delete/68613/bad+code Del: spam -- https://master.php.net/note/delete/68613/spam Del: non-english -- https://master.php.net/note/delete/68613/non-english Del: in docs -- https://master.php.net/note/delete/68613/in+docs Del: other reasons-- https://master.php.net/note/delete/68613 Reject -- https://master.php.net/note/reject/68613 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#115515) next »