ID: 26134 Updated by: [EMAIL PROTECTED] Reported By: bretschneider at element5 dot com -Status: Open +Status: Bogus Bug Type: Regexps related Operating System: freebsd PHP Version: 4.3.2 New Comment:
Just change the quotes (') to double quotes (") for the $pattern var and this will work fine. Previous Comments: ------------------------------------------------------------------------ [2003-11-05 04:48:18] bretschneider at element5 dot com 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 this bug report at http://bugs.php.net/?id=26134&edit=1