|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-01-20 13:11 UTC] felipe@php.net
-Status: Open
+Status: Bogus
[2011-01-20 13:11 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 19:00:02 2025 UTC |
Description: ------------ If the PCRE_DOTALL 's' modifier is specified in the regex, instances of the non-greedy (lazy) operator '?' are ignored. Test script: --------------- $input = <<<END <p>paragraph 1</p> <p>paragraph 2</p> END; print "Output 1:\n"; print preg_replace('|<p.*?>paragraph 2</p>|', '', $input); print "\nOutput 2:\n"; print preg_replace('|<p.*?>paragraph 2</p>|s', '', $input); Expected result: ---------------- Output 1 and Output 2 should be the same, i.e. with the second paragraph removed. Actual result: -------------- Output 2, with the PCRE_DOTALL modifier set, is blank: the first pattern matched greedily.