|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-09-10 23:44 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2020-09-10 23:44 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 01:00:01 2025 UTC |
Description: ------------ PHP 7.4.9 on Alpine image --------------------- # php -m [PHP Modules] apcu blackfire Core ctype curl date dom fileinfo filter ftp gd hash iconv json libxml mbstring mcrypt memcached mongodb mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql pdo_sqlite phalcon Phar posix psr readline redis Reflection session SimpleXML sockets sodium SPL sqlite3 standard tokenizer xdebug xml xmlreader xmlwriter Zend OPcache zip zlib [Zend Modules] Xdebug Zend OPcache blackfire ------------------------- # php --ri pcre pcre PCRE (Perl Compatible Regular Expressions) Support => enabled PCRE Library Version => 10.34 2019-11-21 PCRE Unicode Version => 12.1.0 PCRE JIT Support => enabled PCRE JIT Target => x86 64bit (little endian + unaligned) Directive => Local Value => Master Value pcre.backtrack_limit => 1000000 => 1000000 pcre.recursion_limit => 100000 => 100000 pcre.jit => 1 => 1 Test script: --------------- Using '\pL' escape sequence followed by another escape sequence with a script name (e.g. \p{Arabic}) will incorrectly detect some ASCII characters (at least the "s" (the small letter)). Steps to reproduce: ``` <?php $pattern1 = '/^[0-9_\p{L}\p{Cyrillic}]+$/u'; var_dump(preg_match($pattern1, 's')); var_dump(preg_match($pattern1, 'S')); ``` The output is ``` int(0) int(1) ``` Removing the "\p{Cyrillic}" from the regex pattern above will make it return the expected output: ``` int(1) int(1) ``` Also, as a workaround, adding the "a-zA-Z" sequence in regex pattern would solve the problem. This bug can be checked here as well https://3v4l.org/bqsue