ID:               30071
 Updated by:       [EMAIL PROTECTED]
 Reported By:      wesleywex at gmail dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         PCRE related
 Operating System: Windows 2000 SP4
 PHP Version:      4.3.9RC2
 New Comment:

It's not that hard to write recursive regular expressions that brings
the regex parser to its knees.  As far as I can tell this is what you
have done.  But it is hard to tell as you don't even explain what you
are expecting from the simple case of something like <wsb>abc</wsb>
Plugging that into your regex gets me:
NEO_HTML( &quot;b&quot;, &quot;&quot;, &quot;abc&quot; )
Is that really what you are trying to get?

If you really want to get to the bottom of it, grab PCRE from
www.pcre.org and plug your regular expression into PCRE directly using
the provided pcredemo.c.  This way you won't be using any PHP code.  If
it works perfectly, come back and say so.  If it still shows problems,
file a bug with PCRE.


Previous Comments:
------------------------------------------------------------------------

[2004-09-13 01:57:21] wesleywex at gmail dot com

Description:
------------
I'm trying to replace some multiple tags like <wsb></wsb> and <wsimg>
with only one regex. While I was using few tags, I saw no problem (what
indicates that the regex is valid), but when the tags reaches some
unknown limit, the system makes very odd things, like:

- Not parsing correctly the text
- Taking much more time to proccess the script if just one small new
line is inserted

You can see theese glitches in 3 files I've prepared. All 3 have
similar contents, I just changed one line between them.

Reproduce code:
---------------
Variations:
1: http://wstec.net/tmp/php_bug_pcre_02/code_01.txt
2: http://wstec.net/tmp/php_bug_pcre_02/code_02.txt
3: http://wstec.net/tmp/php_bug_pcre_02/code_03.txt

Actual result:
--------------
Attention to the line with the <wsx />

1: http://wstec.net/tmp/php_bug_pcre_02/code_01.php
- Took more than 1 second to parse the text only 2 times
- Parsed everything as it should be parsed
- Note that there aren't spaces in the text among <!-- and -->

2: http://wstec.net/tmp/php_bug_pcre_02/code_02.php
- Took more than 1 second to parse the text only 1 time
- Not everything that should be parsed was
- Note the only difference is the spaces in the text among <!-- and
-->

3: http://wstec.net/tmp/php_bug_pcre_02/code_03.php
- Took less than 1 second to parse the text the same 2 times than the
firs scipt
- Parsed everything as it should be parsed
- Note that the only difference between the previous scripts is that
line starting with <wsx />

I hope you understand the issue now


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=30071&edit=1

Reply via email to