title: Regular expression to exclude special characters
body: <p>I need a regex for a password which meets following constraints in my rails project:</p>
  
  <ul>
  <li>have a minimum of 8 and a maximum of 16 characters</li>
  <li>be alphanumeric only</li>
  <li>contain at least one letter and one number.</li>
  </ul>
  
  <p>My current regex is: </p>
  
  <pre><code>/^(?=.*\d)(?=.*([a-z]|[A-Z])).{8,16}$/
  </code></pre>
  
  <p>This allows me all the restrictions but the special characters part is not working. What is it that I am doing wrong. Can someone please correct this regex?</p>
  
  <p>Thanks in advance.</p>