title: PHP - regular expression to validate a username with 1 uppercase, any number of lowercase and at least 1 number?
body: <p>My code is:</p>
  
  <pre><code>$user_patt = "/^[A-Za-z0-9]{8,20}$/";
  </code></pre>
  
  <p>however when I use the <code>preg_match</code> to validate the format:</p>
  
  <pre><code>if (preg_match("/user/i", $field)) {
      if (!preg_match($user_patt, $value)) {
          $error_array[] = "$value is an invalid $field";
     }
  }
  </code></pre>
  
  <p>Then I keep getting an error for registering a name such as <em>Granted42</em>. Did I miss something?</p>