|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-02-21 10:38 UTC] moriyoshi@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 21:00:01 2025 UTC |
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