I was attempted to apply multiple @Pattern annotations to a single field:
@Pattern(regexp = \"(?=.*[0-9])\", message = \"Password must contain one digit.\")
Gunnar's solution won't work for me... '.+' in his regexp seem to be missing. However, i'm using Michal's patternList and it works like a charm for me. (Play 2.3.x / Ebean-ORM)
@Pattern.List({
@Pattern(regexp = "(?=.*[0-9]).+", message = "Password must contain one digit."),
@Pattern(regexp = "(?=.*[a-z]).+", message = "Password must contain one lowercase letter."),
@Pattern(regexp = "(?=.*[A-Z]).+", message = "Password must contain one upper letter."),
@Pattern(regexp = "(?=.*[!@#$%^&*+=?-_()/\"\\.,<>~`;:]).+", message ="Password must contain one special character."),
@Pattern(regexp = "(?=\\S+$).+", message = "Password must contain no whitespace.")
})
@Constraints.Required()
public String password1;