note 102203 added to regexp.reference.dot

From: Date: Wed, 02 Feb 2011 11:46:27 +0000
Subject: note 102203 added to regexp.reference.dot
Groups: php.notes 
Request: Send a blank email to php-notes+get-176592@lists.php.net to get a copy of this message
Consider, preg_match_all("/<img.*>/", $htmlfile, $match); Since PCRE_DOTALL is not used, this pattern is expected to NOT make matches across multiple lines. However, in somecases it can, depending on the PCRE default settings and your data ($htmlfile). The problem is that some are set to recognize NEWLINES differently. To fix this use, preg_match_all("/(*ANY)<img.*>/", $htmlfile, $match); Now, any character that could possibly be seen as a newline will be interpreted as a newline by the PCRE. NOTE: This pattern has been available since PCRE version 7.3 ---- Server IP: 69.147.83.197 Probable Submitter: 24.113.79.192 ---- Manual Page -- http://www.php.net/manual/en/regexp.reference.dot.php Edit -- https://master.php.net/note/edit/102203 Del: integrated -- https://master.php.net/note/delete/102203/integrated Del: useless -- https://master.php.net/note/delete/102203/useless Del: bad code -- https://master.php.net/note/delete/102203/bad+code Del: spam -- https://master.php.net/note/delete/102203/spam Del: non-english -- https://master.php.net/note/delete/102203/non-english Del: in docs -- https://master.php.net/note/delete/102203/in+docs Del: other reasons-- https://master.php.net/note/delete/102203 Reject -- https://master.php.net/note/reject/102203 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#176592) next »