Bug #68515 [Com]: preg_match

From: Date: Fri, 28 Nov 2014 01:37:13 +0000
Subject: Bug #68515 [Com]: preg_match
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-188824@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 Comment by: ian dot email at qq dot com Reported by: ian dot email at qq dot com Summary: preg_match Status: Not a bug Type: Bug Package: Filter related Operating System: win7 PHP Version: 5.5.12 Block user comment: N Private report: N New Comment: if(preg_match('/(\\\)u8def/i', "\u535a\u5174\u8def")) echo 55555; exit; three backslash '\\\' will ok, i should use '\\\'? Previous Comments: ------------------------------------------------------------------------ [2014-11-28 01:29:47] ian dot email at qq dot com i want regular JSON data ------------------------------------------------------------------------ [2014-11-27 10:36:38] requinix@php.net 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. ------------------------------------------------------------------------ [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

« previous php.bugs (#188824) next »