mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
commit
77f13bc838
@ -56,7 +56,10 @@ public class PatternPool {
|
||||
* 移动电话
|
||||
*/
|
||||
public final static Pattern MOBILE = Pattern.compile("(?:0|86|\\+86)?1[3-9]\\d{9}");
|
||||
|
||||
/**
|
||||
* 座机号码
|
||||
*/
|
||||
public final static Pattern TEL = Pattern.compile("0\\d{2,3}-[1-9]\\d{6,7}");
|
||||
/**
|
||||
* 18位身份证号码
|
||||
*/
|
||||
|
@ -14,11 +14,6 @@ import java.util.regex.Pattern;
|
||||
*/
|
||||
public class PhoneUtil {
|
||||
|
||||
/**
|
||||
* 座机号码
|
||||
*/
|
||||
private static final Pattern TEL = Pattern.compile("0\\d{2,3}-[1-9]\\d{6,7}");
|
||||
|
||||
/**
|
||||
* 验证是否为手机号码(中国)
|
||||
*
|
||||
@ -38,7 +33,7 @@ public class PhoneUtil {
|
||||
* @since 5.3.11
|
||||
*/
|
||||
public static boolean isTel(CharSequence value) {
|
||||
return Validator.isMatchRegex(TEL, value);
|
||||
return Validator.isMatchRegex(PatternPool.TEL, value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user