|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-12-22 14:17 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 06:00:01 2025 UTC |
Description: ------------ problem with preg_match, dont match right if string contain something eg. \x1d<DIR>s\x1f\x1f\x1f\x1f\x1f\x1faa . Reproduce code: --------------- <? $cn1 = "{__directr[15]} <DIR> aa"; // ok $cn2 = "{__directr[15]}\x1d<DIR>s\x1f\x1f\x1f\x1f\x1f\x1faa"; // not ok if(preg_match("/^(\{\_\_+[a-z]+\[+(.*)+\]\})/i", $cn1)) print("ok<br/>"); else print("not ok<br/>"); if(preg_match("/^(\{\_\_+[a-z]+\[+(.*)+\]\})/i", $cn2)) print("ok<br/>"); else print("not ok<br/>"); ?> Expected result: ---------------- ok ok Actual result: -------------- ok not ok