From:             citricacid at tlen dot pl
Operating system: Ubuntu 8.04 beta
PHP version:      5.2.5
PHP Bug Type:     PCRE related
Bug description:  Returns empty value

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 bug report at http://bugs.php.net/?id=44800&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44800&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44800&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44800&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44800&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44800&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44800&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44800&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44800&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44800&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44800&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44800&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44800&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44800&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44800&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44800&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44800&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44800&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44800&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44800&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44800&r=mysqlcfg

Reply via email to