wp-includes/compat.php:41Returns whether PCRE/u (PCRE_UTF8 modifier) is available for use.
$setbooloptionalnullfunction _wp_can_use_pcre_u( $set = null ) { static $utf8_pcre = null; if ( isset( $set ) ) { _deprecated_argument( __FUNCTION__, '6.9.0' ); } if ( isset( $utf8_pcre ) ) { return $utf8_pcre; } $utf8_pcre = true; set_error_handler( function ( $errno, $errstr ) use ( &$utf8_pcre ) { if ( str_starts_with( $errstr, 'preg_match():' ) ) { $utf8_pcre = false; return true; } return false; }, E_WARNING ); /* * Attempt to compile a PCRE pattern with the PCRE_UTF8 flag. For * systems lacking Unicode support this will trigger a warning * during compilation, which the error handler will intercept. */ preg_match( '//u', '' ); restore_error_handler(); return $utf8_pcre;}Introduced in 4.2.2. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/compat.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.