title: Codeigniter Form Validation Setting Strong Password Validation Rule In an Array
body: <p>I am using codeigniter form validation to validate user data when creating new user. I want to add some sort of password criteria for example password must have 
  at least one capital letter, a number, and one of !, @, #, $ etc) and there have to be 6-25 characters.</p>
  
  <p>This is the array that I am using for validation rules:</p>
  
  <pre><code>$config = array(
             array(
                   'field'   =&gt; 'title',
                   'label'   =&gt; 'Title',
                   'rules'   =&gt; 'trim|required'
                ),
              array(
                   'field'   =&gt; 'firstname',
                   'label'   =&gt; 'First Name',
                   'rules'   =&gt; 'trim|required|min_length[2]|max_length[100]|xss_clean'
                ),
             array(
                   'field'   =&gt; 'lastname',
                   'label'   =&gt; 'Last Name',
                   'rules'   =&gt; 'trim|required|min_length[2]|max_length[100]|xss_clean'
                ),
             array(
                   'field'   =&gt; 'phone',
                   'label'   =&gt; 'Telephone',
                   'rules'   =&gt; 'trim|required|intiger|min_length[11]|max_length[11]|xss_clean'
                ),
             array(
                   'field'   =&gt; 'email',
                   'label'   =&gt; 'Email',
                   'rules'   =&gt; 'trim|required|valid_email|is_unique[ci_user.email]|matches[conf_email]|xss_clean'
                ),
             array(
                   'field'   =&gt; 'conf_email',
                   'label'   =&gt; 'Confirm Email',
                   'rules'   =&gt; 'trim|required|valid_email|xss_clean'
                ),
             array(
                   'field'   =&gt; 'password',
                   'label'   =&gt; 'Password',
                   'rules'   =&gt; 'trim|required|min_length[6]|max_length[25]|matches[conf_password]|xss_clean'
                ),
             array(
                   'field'   =&gt; 'conf_password',
                   'label'   =&gt; 'Confirm Password',
                   'rules'   =&gt; 'trim|required|xss_clean'
                ));
  </code></pre>
  
  <p>Can someone please guide me on how to achieve what I need. Thank you</p>