2

I'm stuck with HTML5 embedded form validation (non javascript). I need to meet all this parameters:

  1. minimum 6 chars

  2. at least 1 number

  3. at least 1 Capital letter

Could you help me to make sure it works as pattern attribute? For example:

<input type="password" pattern="myPattern" /> Thanks.

max
  • 485
  • 5
  • 20
  • Possible duplicate of [Regexp Java for password validation](http://stackoverflow.com/questions/3802192/regexp-java-for-password-validation) – BSMP Jan 22 '17 at 22:22
  • I dived in many of regular expressions, I need just to get it to work as 'pattern' attribute inside the input tag. – max Jan 22 '17 at 22:33
  • 1
    There are patterns in the answers for the duplicate question. – BSMP Jan 22 '17 at 22:35

1 Answers1

3

Thank you guys, I have found a working example and modified it:

<inpupt type="password" pattern="^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=\S+$).{6,}$" />
max
  • 485
  • 5
  • 20