【工具类】验证邮箱

    /** 验证邮箱格式 */
    public static boolean isEmail(String strEmail) {
        String strPattern = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
        Pattern p = Pattern.compile(strPattern);
        Matcher m = p.matcher(strEmail);
        if (m.matches()) {
            return true;
        } else {
            return false;
        }
    }

 

posted on 2013-03-21 12:07  大米稀饭  阅读(175)  评论(0编辑  收藏  举报