#48464 [Opn->Bgs]: No regexp match in utf8 mode
| From: | nlopess@php.net | Date: | Wed, 03 Jun 2009 20:48:45 +0000 |
| Subject: | #48464 [Opn->Bgs]: No regexp match in utf8 mode | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-138024@lists.php.net to get a copy of this message | ||
ID: 48464
Updated by: nlopess@php.net
Reported By: daniel at poradnik-webmastera dot com
-Status: Open
+Status: Bogus
Bug Type: PCRE related
Operating System: windows xp
PHP Version: 5.2.9
New Comment:
$str is not a valid UTF-8 string, and thus the pcre engine rejects it.
no bug here.
Previous Comments:
------------------------------------------------------------------------
[2009-06-03 17:50:59] daniel at poradnik-webmastera dot com
Description:
------------
preg_match() doesn't match string when utf-8 mode is enabled and 0xAB
char ("«") is present in input. Everything works correctly when
utf-8 mode is disabled.
Reproduce code:
---------------
<?php
$str = "test \xab test";
if (preg_match('/test/u', $str))
echo 'Match';
else
echo 'No match';
?>
Expected result:
----------------
'Match' printed
Actual result:
--------------
'No match' printed
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48464&edit=1