Allowed strings for the text field
In your custom module implement hook_form_alter, this will let you add your custom validation handler to the form, something like

  my_module_name_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    if($form_id == 'your_form_id') {
      // Add one more validation.
      $form['#validate'][] = '_my_module_name_custom_form_valition';
    }
  }

  function _my_module_name_custom_form_valition($form, $form_state) {
   // $form_state holds value for submitted fields.
   if(!in_array($allowed_values,$form_state['values']['your_form_field']) {
      form_set_error('your_form_field',t('Entered value is not allowed.'));
   }
  }