From 0c2fc6b05347b11be1cc03af245bd1c19c05eee7 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 16 Sep 2025 19:15:38 +0200 Subject: [PATCH] PHP: remove reference to POSIX regex functions These were removed from PHP in PHP 7.0 and WP nowadays has a PHP 7.2 minimum, which means these function cannot be used anyhow, so this is no longer relevant. --- wordpress-coding-standards/php.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wordpress-coding-standards/php.md b/wordpress-coding-standards/php.md index 9732440..c8fd3e5 100644 --- a/wordpress-coding-standards/php.md +++ b/wordpress-coding-standards/php.md @@ -1012,7 +1012,8 @@ Closures should not be passed as filter or action callbacks, as removing these v ### Regular Expressions -Perl compatible regular expressions ([PCRE](https://www.php.net/pcre), `preg_` functions) should be used in preference to their POSIX counterparts. Never use the `/e` switch, use `preg_replace_callback` instead. +Perl compatible regular expressions ([PCRE](https://www.php.net/pcre), `preg_` functions) should be used. +Never use the `/e` switch, use `preg_replace_callback` instead. It's most convenient to use single-quoted strings for regular expressions since, contrary to double-quoted strings, they have only two metasequences which need escaping: `\'` and `\\`.