note 68613 deleted from function.preg-match-all by colder
| From: | colder@php.net | Date: | Mon, 16 Apr 2007 17:05:10 +0000 |
| Subject: | note 68613 deleted from function.preg-match-all by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-125475@lists.php.net to get a copy of this message | ||
Note Submitter: Stabby at somewhere dot invalid
----
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.