diff --git a/options_element.css b/options_element.css
index db14900..2ff1bac 100644
--- a/options_element.css
+++ b/options_element.css
@@ -39,6 +39,10 @@ div.options-widget a.remove {
   background-image: url(delete.png);
 }
 
+div.default-value-pattern-match {
+  float: left; /* RTL */
+}
+
 div.form-options-manual,
 div.form-option-add {
   text-align: right; /* RTL */
diff --git a/options_element.inc b/options_element.inc
index 98e1fa5..3b6be1a 100644
--- a/options_element.inc
+++ b/options_element.inc
@@ -37,6 +37,9 @@ function theme_options($variables) {
   if (isset($element['default_value_field'])) {
     $options .= drupal_render($element['default_value_field']);
   }
+  if (isset($element['default_value_pattern'])) {
+    $options .= drupal_render($element['default_value_pattern']);
+  }
 
   $settings = '';
   if (isset($element['custom_keys'])) {
@@ -170,6 +173,15 @@ function _form_options_expand($element) {
     }
   }
 
+  // Add the field for storing a default value pattern.
+  if ($element['#default_value_pattern']) {
+    $element['default_value_pattern'] = array(
+      '#type' => 'hidden',
+      '#value' => $element['#default_value_pattern'],
+      '#attributes' => array('class' => array('default-value-pattern')),
+    );
+  }
+
   // Remove properties that will confuse the FAPI.
   unset($element['#options']);
   $element['#required'] = FALSE;
@@ -264,14 +276,14 @@ function _form_type_options_value(&$element, $edit = FALSE) {
         $default_items = explode(',', $edit['default_value_field']);
         foreach ($default_items as $key) {
           $key = trim($key);
-          $value = _form_options_search($key, $options);
+          $value = _form_options_search($key, $options, $element['#default_value_pattern']);
           if (!is_null($value)) {
             $default_value[] = $value;
           }
         }
       }
       else {
-        $default_value = _form_options_search(trim($edit['default_value_field']), $options);
+        $default_value = _form_options_search(trim($edit['default_value_field']), $options, $element['#default_value_pattern']);
       }
     }
     else {
@@ -412,13 +424,16 @@ function _form_options_from_text($text, $key_type, $flat = FALSE, &$duplicates =
 /**
  * Recursive function for finding default value keys. Matches on keys or values.
  */
-function _form_options_search($needle, $haystack) {
+function _form_options_search($needle, $haystack, $include_pattern) {
   if (isset($haystack[$needle])) {
     return $needle;
   }
+  elseif ($include_pattern && preg_match('/' . $include_pattern . '/', $needle)) {
+    return $needle;
+  }
   foreach ($haystack as $key => $value) {
     if (is_array($value)) {
-      return _form_options_search($needle, $value);
+      return _form_options_search($needle, $value, $include_pattern);
     }
     elseif ($value == $needle) {
       return $key;
diff --git a/options_element.js b/options_element.js
index fd1e27f..8ce287f 100644
--- a/options_element.js
+++ b/options_element.js
@@ -38,6 +38,11 @@ Drupal.optionsElement = function(element) {
   this.customKeys = Boolean(element.className.match(/options-key-custom/));
   this.identifier = this.manualOptionsElement.id + '-widget';
   this.enabled = $(this.manualOptionsElement).attr('readonly') == '';
+  this.defaultValuePattern = $(element).find('input.default-value-pattern').val();
+
+  if (this.defaultValuePattern) {
+    this.defaultValuePattern = new RegExp(this.defaultValuePattern)
+  }
 
   // Warning messages.
   this.keyChangeWarning = Drupal.t('Custom keys have been specified in this list. Removing these custom keys may change way data is stored. Are you sure you wish to remove these custom keys?');
@@ -252,8 +257,14 @@ Drupal.optionsElement.prototype.updateManualElements = function() {
 
   // Update with the new text and trigger the change action on the field.
   this.optionsToText();
+
   if (this.manualDefaultValueElement) {
-    this.manualDefaultValueElement.value = multiple ? defaultValue.join(', ') : defaultValue;
+    // Don't wipe out custom pattern-matched default values.
+    defaultValue = multiple ? defaultValue.join(', ') : defaultValue;
+    if (defaultValue || !(this.defaultValuePattern && this.defaultValuePattern.test(this.manualDefaultValueElement.value))) {
+      this.manualDefaultValueElement.value = defaultValue;
+      $('.default-value-pattern-match', this.element).remove();
+    }
   }
 
   $(this.manualOptionsElement).change();
@@ -702,7 +713,7 @@ Drupal.theme.prototype.optionsElement = function(optionsElement) {
       output += Drupal.theme('tableDragIndentation');
     }
     output += '<input type="hidden" class="option-parent" value="' + parent.replace(/"/g, '&quot;') + '" />';
-    output += '<input type="hidden" class="option-depth" value="' + indent.replace(/"/g, '&quot;') + '" />';
+    output += '<input type="hidden" class="option-depth" value="' + indent + '" />';
     if (hasDefault) {
       output += '<input type="' + defaultType + '" name="' + optionsElement.identifier + '-default" class="form-radio option-default" value="' + key.replace(/"/g, '&quot;') + '"' + (status == 'checked' ? ' checked="checked"' : '') + (status == 'disabled' ? ' disabled="disabled"' : '') + ' />';
     }
@@ -753,11 +764,20 @@ Drupal.theme.prototype.optionsElement = function(optionsElement) {
 
   output += '</tbody>';
   output += '</table>';
-  output += '<div>';
+
+  if (optionsElement.defaultValuePattern && optionsElement.manualDefaultValueElement && optionsElement.defaultValuePattern.test(optionsElement.manualDefaultValueElement.value)) {
+    output += Drupal.theme('optionsElementPatternMatch', optionsElement.manualDefaultValueElement.value);
+  }
+
+  output += '</div>';
 
   return output;
 };
 
+Drupal.theme.prototype.optionsElementPatternMatch = function(matchedValue) {
+  return '<div class="default-value-pattern-match"><span>' + Drupal.t('Manual default value') + '</span>: ' + matchedValue + '</div>';
+};
+
 Drupal.theme.prototype.optionsElementAdd = function() {
   return '<div class="form-option-add"><a href="#">' + Drupal.t('Add item') + '</a></div>';
 };
diff --git a/options_element.module b/options_element.module
index 3507650..db007de 100644
--- a/options_element.module
+++ b/options_element.module
@@ -66,6 +66,9 @@
  *   default.
  * - default_value_allowed: Indicates whether the end user should be able to
  *   modify the default value when editing the options list. Defaults to TRUE.
+ * - default_value_pattern: If allowing dynamic default value keys, such as a
+ *   token, specify a regular expression pattern that will also be allowed as
+ *   a default value. Include pattern delimiters. Defaults to an empty string.
  *
  *   @code
  *   $element['options'] = array(
@@ -90,6 +93,7 @@ function options_element_element_info() {
     '#key_type_toggle' => NULL,
     '#key_type_toggled' => FALSE,
     '#default_value_allowed' => TRUE,
+    '#default_value_pattern' => '',
     '#element_validate' => array('form_options_validate'),
     '#disabled' => FALSE,
   );
