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