diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index ce86b74875..bff7edf698 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, will be removed before Drupal 9.0.0.
+ *
+ * @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..a62b875984 100644
--- a/core/includes/install.inc
+++ b/core/includes/install.inc
@@ -14,6 +14,7 @@
 use Drupal\Core\File\FileSystemInterface;
 use Drupal\Core\Site\Settings;
 use Symfony\Component\HttpFoundation\RedirectResponse;
+use Drupal\Core\Database\Database;
 
 /**
  * Requirement severity -- Informational message only.
@@ -165,7 +166,7 @@ function drupal_get_database_types() {
   $drivers = [];
 
   // The internal database driver name is any valid PHP identifier.
-  $mask = '/^' . DRUPAL_PHP_FUNCTION_PATTERN . '$/';
+  $mask = '/^' . Database::DRIVER_NAME_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/lib/Drupal/Core/Database/Database.php b/core/lib/Drupal/Core/Database/Database.php
index d13ea80862..b2c0ae37fd 100644
--- a/core/lib/Drupal/Core/Database/Database.php
+++ b/core/lib/Drupal/Core/Database/Database.php
@@ -34,6 +34,14 @@
    */
   const RETURN_INSERT_ID = 3;
 
+  /**
+   * Regular expression to match driver names.
+   *
+   * @see http://php.net/manual/language.functions.php
+   */
+  const DRIVER_NAME_PATTERN = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*';
+
+
   /**
    * An nested array of all active connections. It is keyed by database name
    * and target.
