#31965 [Ver->Fbk]: PREG_SPLIT_NO_EMPTY strips non-empty pieces in some cases
| From: | tony2001@php.net | Date: | Sun, 26 Jun 2005 23:22:11 +0000 |
| Subject: | #31965 [Ver->Fbk]: PREG_SPLIT_NO_EMPTY strips non-empty pieces in some cases | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-81050@lists.php.net to get a copy of this message | ||
ID: 31965
Updated by: tony2001@php.net
Reported By: mikael at SPAMMENOTchl dot chalmers dot se
-Status: Verified
+Status: Feedback
Bug Type: PCRE related
Operating System: *
PHP Version: 5CVS, 4CVS (2005-05-30)
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
PCRE was upgraded to version 5.0.
Previous Comments:
------------------------------------------------------------------------
[2005-02-14 10:27:15] mikael at SPAMMENOTchl dot chalmers dot se
Description:
------------
In some cases the preg_split strips non-empty pieces when the
PREG_SPLIT_NO_EMPTY flag i set. Specifically when using assertions only
to split on, eg. the string to split on itself is actually empty (but
not the pieces)
Reproduce code:
---------------
$terms = preg_split('/(?<=\d)(?=[a-zåäö])/', 'ser1ia456l', 0,
PREG_SPLIT_NO_EMPTY);
print_r($terms);
Expected result:
----------------
Array
(
[0] => ser1
[1] => ia456
[2] => l
)
Actual result:
--------------
Array
(
[0] => ser1
[1] => ia456
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31965&edit=1