#19853 [Opn->Bgs]: preg_split, PREG_SPLIT_DELIM_CAPTURE does not capture the delimiter
| From: | lange at haas-media dot de | Date: | Thu, 10 Oct 2002 18:32:49 +0000 |
| Subject: | #19853 [Opn->Bgs]: preg_split, PREG_SPLIT_DELIM_CAPTURE does not capture the delimiter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-22097@lists.php.net to get a copy of this message | ||
ID: 19853
User updated by: lange@haas-media.de
Reported By: lange@haas-media.de
-Status: Open
+Status: Bogus
Bug Type: PCRE related
Operating System: Redhat Linux 7.2
PHP Version: 4.2.2
New Comment:
$test = 'This is a text with an $id inside';
$matches = preg_split('#(\$[a-z]*)#', $test,
PREG_SPLIT_DELIM_CAPTURE);
echo '<pre>';
print_r($matches);
echo '</pre>';
expected output:
Array
(
[0] => "This is a text with an "
[1] => $id
[2] => " inside"
)
output produced in the real world:
Array
(
[0] => "This is a text with an "
[1] => " inside"
)
maybe this will help to hunt the bug down.
-- edit
important note: actually no bug at all, missed the limit param.
---
a wise man said: do not report a bug after a hard 10 hour work day.
Previous Comments:
------------------------------------------------------------------------
[2002-10-10 13:24:16] lange@haas-media.de
$test = 'This is a text with an $id inside';
$matches = preg_split('#(\$[a-z]*)#', $test,
PREG_SPLIT_DELIM_CAPTURE);
echo '<pre>';
print_r($matches);
echo '</pre>';
expected output:
Array
(
[0] => "This is a text with an "
[1] => $id
[2] => " inside"
)
output produced in the real world:
Array
(
[0] => "This is a text with an "
[1] => " inside"
)
maybe this will help to hunt the bug down.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19853&edit=1