PHP 4.0 Bug #8129 Updated: ereg returns incorrect results

From: Date: Mon, 08 Jan 2001 23:47:32 +0000
Subject: PHP 4.0 Bug #8129 Updated: ereg returns incorrect results
Groups: php.dev 
Request: Send a blank email to php-dev+get-43493@lists.php.net to get a copy of this message
ID: 8129 Updated by: avsm Reported By: scion@webrelay.net Old-Status: Open Status: Feedback Bug Type: Regexps related Assigned To: Comments: Is this bug still present in php-4.0.4? Previous Comments: --------------------------------------------------------------------------- [2000-12-05 18:22:59] zak@php.net The same code works as expected for me - and I have used similar code on oBSD. Please doublecheck your code. Perhaps the regex is actually '[^a-z]'? --------------------------------------------------------------------------- [2000-12-05 18:15:36] scion@webrelay.net <?php $str[] = "Makefile"; $str[] = "makefile"; $str[] = ".."; $str[] = "X-picturev"; $regexp = "^[a-z]"; while ( list( $key, $e) = each($str) ){ if( ereg( $e, $regexp)) echo "$e is lower<br>"; else echo "$e is UPPER<br>"; } ?> confugured --regex=pcre http://tbiz.webrelay.net/test/ereg.php will illustrate the bug and show phpinfo(); Also php4.0pl1 with OpenBSD with -regex=php will behave similarly. --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=8129

« previous php.dev (#43493) next »