From: mw at lanfear dot com Operating system: Windows XP SP1 Only PHP version: 5.0.3 PHP Bug Type: *Regular Expressions Bug description: mbregex fails to recognise word boundary markers [[:<:]] on Windows XP
Description: ------------ The mbregex compiler appears to have a bug in it via which it cannot compile the word boundary markers [[:<:]] and [[:>:]] on the Windows version of PHP. (IIS5.1, PHP 5.0.3) On the Unix version of PHP, these boundaries work fine, with or without the mbstring and mbregex extension enabled, and the Windows versions of PHP will also recognise these markers IFF the mbstring.dll is disabled. Given the string: $strr "This is an ip address: 192.168.1.1 ..." The following: ereg("[[:<:]][0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[[:>:]]", $strr, $regex); will generate the following error in windows (IIS5.1, PHP 5.0.3), provided mbstring is enabled: Warning: mb_ereg() [function.mb-ereg]: mbregex compile err: invalid POSIX bracket type in c:\Inetpub\wwwroot\regex_test.php on line 5 NULL Reproduce code: --------------- <?php $ipaddrs = "192.168.12.22, then followed by 192.168.1.1"; ereg("[[:<:]][0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[[:>:]]", $ipaddrs, $regex); var_dump($regex); ?> Expected result: ---------------- array(1) { [0]=> string(13) "192.168.12.22" } Actual result: -------------- Warning: mb_ereg() [function.mb-ereg]: mbregex compile err: invalid POSIX bracket type in c:\Inetpub\wwwroot\regex_test.php on line 5 NULL -- Edit bug report at http://bugs.php.net/?id=31576&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31576&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31576&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31576&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=31576&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=31576&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31576&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31576&r=needscript Try newer version: http://bugs.php.net/fix.php?id=31576&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31576&r=support Expected behavior: http://bugs.php.net/fix.php?id=31576&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31576&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31576&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=31576&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31576&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=31576&r=dst IIS Stability: http://bugs.php.net/fix.php?id=31576&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31576&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31576&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=31576&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=31576&r=mysqlcfg