How to add special character validation on specific field in form registration process I want to add a special character validation on a specfic field. 
Here I have my code but it does not work and there is no error.

function mymodule_form_alter(&amp;$form, &amp;$form_state, &amp;$form_id) { 
   if ($form_id == 'registration_node_form') {
        $form['#validate'][] = 'mymodule_form_validate';        
   }
}

function mymodule_form_validate($form, $form_state){
    if(isset ($form['field_employer_name']['und'][0]['value']['#default_value'])){
        $special_character_list = '[\'^£$%&amp;*()}{@#~?&gt;&lt;&gt;,|=_+¬-]'; 
        if (preg_match($special_character_list, $form_state['field_employer_name']['und'][0]['value']['#default_value'])== 0) {
            form_set_error('field_employer_name', t('The specified form name contains one or more illegal characters. Spaces or any other special characters except dash (-) and underscore (_) are not allowed.'));
        }
    }
}


Please help. Thank You.
Try using Field Validation  Module it simplifies your work!!

If you want to code it then check this post It solves the same issue

Try changing your code:

 $special_character_list = '\'^£$%&amp;*()}{@#~?&gt;&lt;&gt;,|=_+¬\-\[\]';
  if(preg_match('/[' . $special_character_list . ']/',$form_state['field_employer_name']['und'][0]['value']['#default_value']) !== 0)