Guest User

Untitled

a guest
Jun 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. // Id starts with alphabet and alphanumeric characters. Minimum length 4, Maximum length 20.
  2. @Pattern(regexp = "^[a-zA-Z]{1}[a-zA-Z0-9_]{4,20}$")
  3.  
  4. // Password requires at least number, capital character, non-capital character and special character. Minimum length 8, Maximum length 20.
  5. // ^ # start-of-string
  6. // (?=.*[0-9]) # a digit must occur at least once
  7. // (?=.*[a-z]) # a lower case letter must occur at least once
  8. // (?=.*[A-Z]) # an upper case letter must occur at least once
  9. // (?=.*[@#$%^&+=]) # a special character must occur at least once
  10. // (?=\S+$) # no whitespace allowed in the entire string
  11. // .{8,20} # anything, at least eight places at most 20 though
  12. //$ # end-of-string
  13. @Pattern(regexp = "((?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{8,20})"
Add Comment
Please, Sign In to add comment