mirror of https://github.com/qiurunze123/miaosha
22 lines
426 B
Java
22 lines
426 B
Java
package com.geekq.common.utils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import java.util.regex.Matcher;
|
|
import java.util.regex.Pattern;
|
|
|
|
public class ValidatorUtil {
|
|
|
|
private static final Pattern mobile_pattern = Pattern.compile("1\\d{10}");
|
|
|
|
public static boolean isMobile(String src) {
|
|
if(StringUtils.isEmpty(src)) {
|
|
return false;
|
|
}
|
|
Matcher m = mobile_pattern.matcher(src);
|
|
return m.matches();
|
|
}
|
|
|
|
|
|
}
|