diff --git a/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php b/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php
index eed8739..20ad4c8 100644
--- a/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php
+++ b/core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php
@@ -257,6 +257,25 @@ public static function extractEntityIdFromAutocompleteInput($input) {
   }
 
   /**
+   * Extracts the entity label from the autocompletion result.
+   *
+   * @param string $input
+   *   The input coming from the autocompletion result.
+   *
+   * @return mixed|null
+   *   An entity label or NULL if the input does not contain one.
+   */
+  public static function extractEntityLabelFromAutocompleteInput($input) {
+    $match = NULL;
+
+    // Extract the label from "label (entity id)'.
+    if (preg_match("/(.+)\(.+\)/", $input, $matches)) {
+      $match = trim($matches[1]);
+    }
+    return $match;
+  }
+
+  /**
    * Creates a new entity from a label entered in the autocomplete input.
    *
    * @param string $entity_type_id
