#26134 [NEW]: ereg not working with hex regex

From: Date: Wed, 05 Nov 2003 09:48:18 +0000
Subject: #26134 [NEW]: ereg not working with hex regex
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-50028@lists.php.net to get a copy of this message
From: bretschneider at element5 dot com Operating system: freebsd PHP version: 4.3.2 PHP Bug Type: Regexps related Bug description: ereg not working with hex regex Description: ------------ ereg does not seam to work with \x values. it can only matches uppercase !! but \x21-\x7a includes all upper and lower case characters. for some reasons i must use ereg and NOT eregi. preg_match does work! but it does not work with utf-8 Reproduce code: --------------- $URLS = array(1 => 'FOUND', 2 => 'notfound'); $pattern = '[\x21-\x7a]+'; foreach ($URLS as $key => $url) { print $url; if (ereg($pattern, $url)) print " ............ OK\n"; else print " .............. FAILED\n"; } Expected result: ---------------- FOUND ............ OK notfound .............. OK Actual result: -------------- FOUND ............ OK notfound .............. FAILED -- Edit bug report at http://bugs.php.net/?id=26134&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26134&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26134&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=26134&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=26134&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=26134&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=26134&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=26134&r=support Expected behavior: http://bugs.php.net/fix.php?id=26134&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=26134&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=26134&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=26134&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26134&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=26134&r=dst IIS Stability: http://bugs.php.net/fix.php?id=26134&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=26134&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=26134&r=float

« previous php.bugs (#50028) next »