标签:style blog color java ar div log sp
import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; public class test{ public static void main(String args[]){ System.out.println(test.isEmail("lala@qq.com")); } public static boolean isEmail(String email){ String str="^" + "([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)*@" + "([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)+" + "[\\.][A-Za-z]{2,3}" + "([\\.][A-Za-z]{2})?" + "$"; Pattern p = Pattern.compile(str); Matcher m = p.matcher(email); return m.matches(); } }
标签:style blog color java ar div log sp
原文地址:http://www.cnblogs.com/seven7seven/p/3913470.html