diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index ce86b74875..f136ceff8c 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -140,6 +140,10 @@
 /**
  * Regular expression to match PHP function names.
  *
+ * @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
+ *   \Drupal\Core\Extension\ExtensionDiscovery::PHP_FUNCTION_PATTERN instead.
+ *
+ * @see https://www.drupal.org/node/2936107
  * @see http://php.net/manual/language.functions.php
  */
 const DRUPAL_PHP_FUNCTION_PATTERN = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*';
diff --git a/core/includes/install.inc b/core/includes/install.inc
index 360290430b..dcd11debeb 100644
--- a/core/includes/install.inc
+++ b/core/includes/install.inc
@@ -165,7 +165,7 @@ function drupal_get_database_types() {
   $drivers = [];
 
   // The internal database driver name is any valid PHP identifier.
-  $mask = '/^' . DRUPAL_PHP_FUNCTION_PATTERN . '$/';
+  $mask = ExtensionDiscovery::PHP_FUNCTION_PATTERN;
   /** @var \Drupal\Core\File\FileSystemInterface $file_system */
   $file_system = \Drupal::service('file_system');
   $files = $file_system->scanDirectory(DRUPAL_ROOT . '/core/lib/Drupal/Core/Database/Driver', $mask, ['recurse' => FALSE]);
diff --git a/core/modules/update/update.module b/core/modules/update/update.module
index 1327944481..c7d69c26b4 100644
--- a/core/modules/update/update.module
+++ b/core/modules/update/update.module
@@ -693,7 +693,7 @@ function update_verify_update_archive($project, $archive_file, $directory) {
   $incompatible = [];
   /** @var \Drupal\Core\File\FileSystemInterface $file_system */
   $file_system = \Drupal::service('file_system');
-  $files = $file_system->scanDirectory("$directory/$project", '/^' . DRUPAL_PHP_FUNCTION_PATTERN . '\.info.yml$/', ['key' => 'name', 'min_depth' => 0]);
+  $files = $file_system->scanDirectory("$directory/$project", '/.*\.info.yml$/', ['key' => 'name', 'min_depth' => 0]);
   foreach ($files as $file) {
     // Get the .info.yml file for the module or theme this file belongs to.
     $info = \Drupal::service('info_parser')->parse($file->uri);
