Matcher matcher = pattern.matcher(input) //进行匹配
if (matcher.matches()) check = true;
return check;
boolean check = false;
String regex = "\w+@\w+\.(com)|(cn)";
String input = "19100390888";
Pattern pattern = Pattern.compile(regex) //编译正则表达式
Matcher matcher = pattern.matcher(input) //进行匹配
if (matcher.matches()) check = true;
return check;