Bug #68515 [Opn->Nab]: preg_match
| From: | requinix@php.net | Date: | Thu, 27 Nov 2014 10:36:39 +0000 |
| Subject: | Bug #68515 [Opn->Nab]: preg_match | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-188816@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68515&edit=1
ID: 68515
Updated by: requinix@php.net
Reported by: ian dot email at qq dot com
Summary: preg_match
-Status: Open
+Status: Not a bug
Type: Bug
Package: Filter related
Operating System: win7
-PHP Version: 5.6.3
+PHP Version: 5.5.12
Block user comment: N
Private report: N
New Comment:
PHP doesn't have a \u escape sequence, though it is being discussed for a future version. Thus
the "\u" will remain in the string as a literal backslash and 'u' and
you'll get the warning.
Previous Comments:
------------------------------------------------------------------------
[2014-11-27 10:28:53] ian dot email at qq dot com
PHP Version 5.5.12
------------------------------------------------------------------------
[2014-11-27 10:27:44] ian dot email at qq dot com
Description:
------------
if(preg_match('/\\u8def/i', "\u535a\u5174\u8def"))
echo 55555;
exit;
Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N{name}, \U, or \u at
offset 1
Test script:
---------------
if(preg_match('/\\u8def/i', "\u535a\u5174\u8def"))
echo 55555;
exit;
Warning: preg_match(): Compilation failed: PCRE does not support \L, \l, \N{name}, \U, or \u at
offset 1
Expected result:
----------------
if(preg_match('/\\u8def/i', "\u535a\u5174\u8def"))
===> echo 55555;
exit;
Actual result:
--------------
if(preg_match('/\\\u8def/i', "\u535a\u5174\u8def")) ? \\\?
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68515&edit=1