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. + + + 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