Java Reference
In-Depth Information
one or more lowercase letters, one or
// more uppercase letters, and be a minimum of
6 characters in length.
//
@Override
public boolean validate(String fieldValue) {
return
Pattern.matches("((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,})",
fieldValue);
}
},
EMAIL_ADDRESS("email") {
// An email address begins with a combination of
alphanumeric characters, periods,
// and hyphens, followed by a mandatory ampersand
(@) character, followed by
// a combination of alphanumeric characters
(hyphens allowed), followed by a
// one or more periods (to separate domains and
subdomains), and ending in 2-4
// alphabetic characters representing the domain.
//
@Override
public boolean validate(String fieldValue) {
return
Pattern.matches("^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z|a-z]{2,4}$",
fieldValue);
}
},
PHONE_NUMBER("phone") {
// A phone number must contain a minium of
7 digits. Three optional digits
// representing the area code may appear in front
of the main 7 digits. The area
Search WWH ::




Custom Search