测试用户
2023-04-13 43393f2bb11cbf9e6af40077bbc5284660e8a754
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.common.core.utils;
 
 
import java.util.regex.Pattern;
 
/**
 * @Author holfeng
 * @Date 10:18 28/03/2022
 * @Version 1.0
 **/
public class RegexUtils {
 
 
 
    /**
     * 判断是否是手机号
     * @param tel 手机号
     * @return boolean true:是  false:否
     */
    public static boolean isMobile(String tel) {
        Pattern p = Pattern.compile("((\\+86|0086)?\\s*)((134[0-8]\\d{7})|(((13([0-3]|[5-9]))|(14[5-9])|15([0-3]|[5-9])|(16(2|[5-7]))|17([0-3]|[5-8])|18[0-9]|19(1|[8-9]))\\d{8})|(14(0|1|4)0\\d{7})|(1740([0-5]|[6-9]|[10-12])\\d{7}))");
        if(p.matcher(tel).matches()){
            return true;
        }
        return false;
    }
 
}