diff --git a/core/modules/field/modules/options/options.module b/core/modules/field/modules/options/options.module
index e958510..74ca27d 100644
--- a/core/modules/field/modules/options/options.module
+++ b/core/modules/field/modules/options/options.module
@@ -305,8 +305,8 @@ function options_extract_allowed_values($string, $field_type, $generate_keys) {
     // Check for an explicit key.
     $matches = array();
     if (preg_match('/(.*)\|(.*)/', $text, $matches)) {
-      $key = $matches[1];
-      $value = $matches[2];
+      $key = trim($matches[1]);
+      $value = trim($matches[2]);
       $explicit_keys = TRUE;
     }
     // Otherwise see if we can use the value as the key. Detecting true integer
