From 2a5791712404a296f8b998372c78df0db048d082 Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Sat, 16 Nov 2024 13:58:21 +0700 Subject: [PATCH 1/3] [PHP 8.4] PCRE: Add `/r` modifier --- reference/pcre/pattern.modifiers.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reference/pcre/pattern.modifiers.xml b/reference/pcre/pattern.modifiers.xml index d26ab6fb1c9f..b80c7f3683b7 100644 --- a/reference/pcre/pattern.modifiers.xml +++ b/reference/pcre/pattern.modifiers.xml @@ -187,6 +187,22 @@ + + r (PCRE2_EXTRA_CASELESS_RESTRICT) + + + When u (PCRE_UTF8) and i (PCRE_CASELESS) + are in effect, this modifier prevents matching across ASCII and non-ASCII characters. + + + For example, preg_match('/\x{212A}/iu', "K") matches the Kelvin sign (U+212A). + When u is used (preg_match('/\x{212A}/iur', "K")), it does not match. + + + Available as of PHP 8.4.0. + + + From 8d3c7b01550d38390cea28c31f082b8fa77a1b62 Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Sat, 16 Nov 2024 13:58:48 +0700 Subject: [PATCH 2/3] [PHP 8.4] PCRE: Add PCRE2-v10.44 quantifier changes --- reference/pcre/pattern.syntax.xml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/reference/pcre/pattern.syntax.xml b/reference/pcre/pattern.syntax.xml index 7182b0e5c020..757b11d7368c 100644 --- a/reference/pcre/pattern.syntax.xml +++ b/reference/pcre/pattern.syntax.xml @@ -1573,11 +1573,22 @@ \d{8} - matches exactly 8 digits. An opening curly bracket that + matches exactly 8 digits. + + + + Prior to PHP 8.4.0, an opening curly bracket that appears in a position where a quantifier is not allowed, or one that does not match the syntax of a quantifier, is taken - as a literal character. For example, {,6} is not a quantifier, - but a literal string of four characters. + as a literal character. For example, {,6} + is not a quantifier, but a literal string of four characters. + + As of PHP 8.4.0, the PCRE extension is bundled with PCRE2 version 10.44, + which allows patterns such as \d{,8} and they are + interpreted as \d{0,8}. + + Further, as of PHP 8.4.0, space characters around quantifiers such as + \d{0 , 8} and \d{ 0 , 8 } are allowed. The quantifier {0} is permitted, causing the expression to From bc9f56bdbe3aa878d4b5d2db92bebf5fc8a5fc19 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 20 Nov 2024 16:56:58 +0000 Subject: [PATCH 3/3] simpara --- reference/pcre/pattern.syntax.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/pcre/pattern.syntax.xml b/reference/pcre/pattern.syntax.xml index 757b11d7368c..6dbc6c753226 100644 --- a/reference/pcre/pattern.syntax.xml +++ b/reference/pcre/pattern.syntax.xml @@ -1576,7 +1576,7 @@ matches exactly 8 digits. - + Prior to PHP 8.4.0, an opening curly bracket that appears in a position where a quantifier is not allowed, or one that does not match the syntax of a quantifier, is taken @@ -1589,7 +1589,7 @@ Further, as of PHP 8.4.0, space characters around quantifiers such as \d{0 , 8} and \d{ 0 , 8 } are allowed. - + The quantifier {0} is permitted, causing the expression to behave as if the previous item and the quantifier were not