src/main/java/com/nathan/crm/utils/PhoneUtil.java
(完整代码) 717Bpackage com.nathan.crm.utils;
import org.apache.commons.lang3.StringUtils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class PhoneUtil {
public static boolean isMobile(String phone){
Pattern p = null;
Matcher m = null;
boolean b = false;
// 验证手机号
String s2="^[1](([3|5|8][\\d])|([4][4,5,6,7,8,9])|([6][2,5,6,7])|([7][^9])|([9][1,8,9]))[\\d]{8}$";
if(StringUtils.isNotBlank(phone)){
p = Pattern.compile(s2);
m = p.matcher(phone);
b = m.matches();
}
return b;
}
public static void main(String[] args) {
System.out.println(isMobile("19699999999"));
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。