#44800 [Csd->Bgs]: Returns empty value

From: Date: Tue, 22 Apr 2008 21:01:35 +0000
Subject: #44800 [Csd->Bgs]: Returns empty value
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-124432@lists.php.net to get a copy of this message
ID: 44800 Updated by: scottmac@php.net Reported By: citricacid at tlen dot pl -Status: Closed +Status: Bogus Bug Type: PCRE related Operating System: Ubuntu 8.04 beta PHP Version: 5.2.5 Previous Comments: ------------------------------------------------------------------------ [2008-04-22 18:54:18] citricacid at tlen dot pl I was wrong. Sorry. Everything is fine. That value is invisible because it contains hidden html tag. Stupid me. ------------------------------------------------------------------------ [2008-04-22 18:43:45] citricacid at tlen dot pl Description: ------------ I try to preg_grep an array which contains some html strings. Each line is an array element. If the expression string matches searched string from the beginnig to the end then everything is fine. If the expression string matches a substring then an empty value is returned. Reproduce code: --------------- Array - $templateArray: [9] <textarea name="senddata"> [10] {ccms:textile} [11] </textarea><br /> [12] <input type="hidden" value="{ccms:idmenu}" name="ccmsid" id="ccmsid"> Code: $cml = preg_grep("/\{ccms:.+\}/", $templateArray) echo "<pre>"; print_r($cml); echo "</pre>"; Expected result: ---------------- Array ( [10] => {ccms:textile} [12] => <input type="hidden" value="{ccms:idmenu}" name="ccmsid" id="ccmsid"> ) Actual result: -------------- Array ( [10] => {ccms:textile} [12] => ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44800&edit=1

« previous php.bugs (#124432) next »