#29802 [Bgs->Opn]: Glitch using preg_match and preg_replace
| From: | wesleygoku at yahoo dot com dot br | Date: | Sun, 12 Sep 2004 22:06:37 +0000 |
| Subject: | #29802 [Bgs->Opn]: Glitch using preg_match and preg_replace | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66114@lists.php.net to get a copy of this message | ||
ID: 29802
User updated by: wesleygoku at yahoo dot com dot br
Reported By: wesleygoku at yahoo dot com dot br
-Status: Bogus
+Status: Open
Bug Type: PCRE related
Operating System: Windows 2000 SP4
PHP Version: 4.3.9RC2
New Comment:
The problem ISN'T in my regex. If you see my post from 26 Aug 10:25pm
CEST, you'll notice this, see: the problem ONLY happens with many
"tags", if I reduce it (and I can't do this in the original script), it
doesn't happen! How can this kind of behaviour be something in MY
regex?!
Previous Comments:
------------------------------------------------------------------------
[2004-09-10 13:10:21] nlopess@php.net
From what I could read, the problem is in your regex.
------------------------------------------------------------------------
[2004-09-06 15:48:33] wesleygoku at yahoo dot com dot br
Updated to the latest PHP build, but the problem remains...
------------------------------------------------------------------------
[2004-08-26 22:25:45] wesleygoku at yahoo dot com dot br
To clarify the bug, let's explain it better: I'm using preg_replace to
replace some code. If this code is bigger than an unknown lenght,
something very weird happens.
I'm using while to replace ALL of the occurrences in some string, but
the preg_match used to verify if the text still appears just tells the
code DOESN'T match, although it does!
Now, see the problem:
This doesn't work, note that many "<ws..." are still there
Source code: http://wstec.net/tmp/php_bug_pcre/code_01.html
Results: http://wstec.net/tmp/php_bug_pcre/code_01.php
Now, without the first two <wsimg>, id works as it should
Source code: http://wstec.net/tmp/php_bug_pcre/code_02.html
Results: http://wstec.net/tmp/php_bug_pcre/code_02.php
I ask you to take a good look at this bug, because I need a resolution
about it to keep working on my script. And also note that it isn't with
my code, but with the PHP's funcion preg_match and preg_replace.
------------------------------------------------------------------------
[2004-08-24 18:08:02] wesleygoku at yahoo dot com dot br
This is the problem, if I reduce the code, it works. I've checked the
XHTML code and the Regular Expression, but everything is fine.
------------------------------------------------------------------------
[2004-08-24 08:38:50] derick@php.net
Please provide a very short example without endless pieces of HTML/XML
code.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/29802
--
Edit this bug report at http://bugs.php.net/?id=29802&edit=1