#30071 [NEW]: Many problems with Perl-Compatible Regular Expressions
| From: | wesleywex at gmail dot com | Date: | Sun, 12 Sep 2004 23:57:24 +0000 |
| Subject: | #30071 [NEW]: Many problems with Perl-Compatible Regular Expressions | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-66118@lists.php.net to get a copy of this message | ||
From: wesleywex at gmail dot com
Operating system: Windows 2000 SP4
PHP version: 4.3.9RC2
PHP Bug Type: PCRE related
Bug description: Many problems with Perl-Compatible Regular Expressions
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 bug report at http://bugs.php.net/?id=30071&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30071&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30071&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30071&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30071&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30071&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30071&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30071&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30071&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30071&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30071&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30071&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30071&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30071&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30071&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30071&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30071&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30071&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30071&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30071&r=mysqlcfg