title: Ruby on Rails user and password validation
body: <p>I have specific requirements for user registration validation of username and password using bcrypt only (no devise!)</p>
  
  <p>I currently have working:</p>
  
  <pre><code>validates :username,
            presence: true,
            length: { minimum: 2, maximum: 15 },
            uniqueness: true
  
  validates :password, 
            presence: true,
            length: { minimum: 10 },
  </code></pre>
  
  <p>I need:</p>
  
  <ul>
  <li>Username:
  
  <ol>
  <li>Can only contain letters, digits, dashes and underscores</li>
  </ol></li>
  <li>Password:
  
  <ol>
  <li>Must contain at least one uppercase letter, one special 
             character, one number and one lowercase letter</li>
  </ol></li>
  </ul>