ID: 39947
Updated by: [EMAIL PROTECTED]
Reported By: dlanoire at neuf dot fr
-Status: Open
+Status: Bogus
Bug Type: PCRE related
Operating System: Windows XP SP2
PHP Version: 5.2.0
New Comment:
I get the very same result using Perl script, which means it's a PCRE
library bug/feature and it should be reported to PCRE developers.
Previous Comments:
------------------------------------------------------------------------
[2006-12-25 18:11:54] dlanoire at neuf dot fr
Description:
------------
When I try replace the dot by "_d_", preg_replace fails to replace all
dots separated by only 1 character. Only One substitution by 2 is
working.
Reproduce code:
---------------
$texte = preg_replace("/(\w)\.(\w)/", "$1_d_$2", "a.b.c.d.e.f");
Expected result:
----------------
The result is a_d_b.c_d_d.e_d_f
Actual result:
--------------
The result should be a_d_b_d_c_d_d_d_e_d_f
On the other side, the replacement below works and gives the good
result : aa_d_bb_d_cc_d_dd_d_ee_d_ff
$texte = preg_replace("/(\w)\.(\w)/", "$1_d_$2", "aa.bb.cc.dd.ee.ff");
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39947&edit=1