MCPcopy Create free account
hub / github.com/Hello-hao/Tbed / checkEmail

Method checkEmail

src/main/java/cn/hellohao/utils/SetText.java:56–68  ·  view source on GitHub ↗

验证邮箱 @param email @return

(String email)

Source from the content-addressed store, hash-verified

54 * @return
55 */
56 public static boolean checkEmail(String email) {
57 boolean flag = false;
58 try {
59 String check = "^\\w+@[a-zA-Z0-9]{2,10}(?:\\.[a-z]{2,4}){1,3}$";
60// String regex = "\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"; //这个也可以用
61 Pattern regex = Pattern.compile(check);
62 Matcher matcher = regex.matcher(email);
63 flag = matcher.matches();
64 } catch (Exception e) {
65 flag = false;
66 }
67 return flag;
68 }
69
70}
71

Callers 3

setUserInfoMethod · 0.95
RegisterMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected