Bug #78420 [Com]: preg_match failed with Unicode character scripts

From: Date: Fri, 16 Aug 2019 10:04:46 +0000
Subject: Bug #78420 [Com]: preg_match failed with Unicode character scripts
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222266@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78420&edit=1 ID: 78420 Comment by: daverandom@php.net Reported by: noskov dot vlad at gmail dot com Summary: preg_match failed with Unicode character scripts Status: Open Type: Bug Package: PCRE related PHP Version: 7.4.0beta2 Block user comment: N Private report: N New Comment: The problem is more subtle than this, as the following all work: var_dump(preg_match('~[\pL\p{Cyrillic}]~u', 'testЛ')); var_dump(preg_match('~[\pL]~u', 'testЛ')); var_dump(preg_match('~[\p{Cyrillic}]~u', 'testЛ')); var_dump(preg_match('~[\pL]~u', 'test')); var_dump(preg_match('~[\p{Cyrillic}]~u', 'Л')); var_dump(preg_match('~\pL~u', 'Л')); var_dump(preg_match('~\p{Cyrillic}~u', 'testЛ')); var_dump(preg_match('~\pL\p{Cyrillic}~u', 'testЛ')); Previous Comments: ------------------------------------------------------------------------ [2019-08-16 10:04:29] requinix@php.net Works with JIT disabled. ------------------------------------------------------------------------ [2019-08-16 09:51:03] noskov dot vlad at gmail dot com Description: ------------ When running preg_match with Unicode character scripts in regular expression it always return 0. https://3v4l.org/sil9c Test script: --------------- var_dump(preg_match('~[\pL\p{Cyrillic}]~u', 'test')); Expected result: ---------------- int(1) Actual result: -------------- int(0) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78420&edit=1

« previous php.bugs (#222266) next »