title: How do I prevent special characters with Codeigniter's form validation?
body: <p>I have a username field that I don't want to accept characters like <code>{*)&amp;(%^%()_}</code>. What do I need to add to my form validation rules?</p>
  
  <pre><code>$this-&gt;form_validation-&gt;set_rules('user_name' 'User Name', 'trim|required|min_length[4]|xss_clean');
  </code></pre>