title: Password Validation using hibernate bean validation
body: <p>I am trying to validate user input password against set of rules and here are those rules.</p>
  
  <ol>
  <li>Minimum 6 and Maximum 8 Character.</li>
  <li>Atleast 1 number</li>
  <li>Atleast 1 alphabet in capitals.</li>
  <li>No Special char allowed</li>
  </ol>
  
  <p>this is what i have done so far in my bean class</p>
  
  <pre><code>@NotNull(message = "{register.pwd.invalid}")
      @Size(min = 6, max = 8, message = "{register.pwd.invalid}")
      public String getPwd()
      {
          return pwd;
      }
  </code></pre>
  
  <p>I believe for the rest part i have to use regExp but not sure what regular expression i need to have, this is what i came up</p>
  
  <pre><code>^.*(?=.{6,8})(?=.*\d)(?=.*[A-Z]).*$
  </code></pre>
  
  <p>i am not sure about the expression as i am not good in regExp,can any one help me to point in correcting the regExp</p>