Bug #80961 [Opn]: PCRE treats ellipsis character as a letter

From: Date: Fri, 16 Apr 2021 09:19:32 +0000
Subject: Bug #80961 [Opn]: PCRE treats ellipsis character as a letter
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233464@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80961&edit=1 ID: 80961 User updated by: f dot sowade at r9e dot de Reported by: f dot sowade at r9e dot de Summary: PCRE treats ellipsis character as a letter Status: Open Type: Bug Package: PCRE related Operating System: Linux and Mac OS X PHP Version: 8.0.3 Block user comment: N Private report: N New Comment: Sorry - the Test script should have had a P instead of a Z: var_dump(IntlChar::ispunct("\u{2026}")); // true var_dump(IntlChar::isalpha("\u{2026}")); // false var_dump(preg_match('/\\p{P}/', "\u{2026}")); // 0 (but would expect 1) var_dump(preg_match('/\\p{L}/', "\u{2026}")); // 1 (but would expect 0) Previous Comments: ------------------------------------------------------------------------ [2021-04-16 09:14:18] f dot sowade at r9e dot de Description: ------------ The intl extension reports the Unicode ellipsis character (U+2026) to be a punctuation. PCRE matches the ellipsis when matching letters but not when matching punctuation. So the character class for the ellipsis differs between the intl extension and PCRE. I think that intl is correct here and the character class should be punctuation. But both extensions should at least agree on the same character class. Test script: --------------- var_dump(IntlChar::ispunct("\u{2026}")); // true var_dump(IntlChar::isalpha("\u{2026}")); // false var_dump(preg_match('/\\p{Z}/', "\u{2026}")); // 0 (but would expect 1) var_dump(preg_match('/\\p{L}/', "\u{2026}")); // 1 (but would expect 0) Expected result: ---------------- bool(true) bool(false) int(1) int(0) Actual result: -------------- bool(true) bool(false) int(0) int(1) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80961&edit=1

« previous php.bugs (#233464) next »