how to verify a email address and password?
正規式
test:http://regexr.com/
create 正規式:http://www.txt2re.com/index.php3s
private boolean isAEmail(String email) {
String re1 = "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$"; // Email Address 1
Pattern p = Pattern.compile(re1, Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
Matcher m = p.matcher(email);
return m.matches();
}
|