Verify the email address and regular expression. Verify the regular expression.
/*** Verify that the email address is correct ** @ param email * @ return */public static boolean checkEmail (String email) {boolean flag = false; try {String check = "^ ([a-z0-9A-Z] + [-| \.]?) + [A-z0-9A-Z] @ ([a-z0-9A-Z] + (-[a-z0-9A-Z] + )? \\.) + [A-zA-Z] {2,} $ "; Pattern regex = Pattern. compile (check); Matcher matcher = regex. matcher (email); flag = matcher. matches ();} catch (Exception e) {flag = false;} return flag ;} /*** verify the mobile phone number ** @ param mobiles * @ return */public static boolean isMobileNO (String mobiles) {boolean flag = false; try {Pattern p = Pattern. compile ("^ (13 [0-9]) | (15 [^ 4, \ D]) | (18 [-9]) \ d {8} $ "); Matcher m = p. matcher (mobiles); flag = m. matches ();} catch (Exception e) {flag = false;} return flag ;}