mobileexp:=`(^((13[4-9]|14[7-8]|15[0-27-9]|17[28]|18[2-47-8]|198)\d{8})$)|(^((170[35-6]|1440)\d{7})$)`
unicomexp:=`(^((13[0-2]|14[05-6]|15[5-6]|166|17[15-6]|18[5-6])\d{8})$)|(^(170[47-9]\d{7})$)`
telcomexp:=`(^((133|149|153|17[37]|18[0-19]|199)\d{8})$)|(^((170[0-2]|1349|1410)\d{7})$)|(^(1740[0-5]\d{6})$)`
//golang测试
func TestMobile(t *testing.T) {
mobileexp:=`(^((13[4-9]|14[7-8]|15[0-27-9]|17[28]|18[2-47-8]|198)\d{8})$)|(^((170[35-6]|1440)\d{7})$)`
//unicomexp:=`(^((13[0-2]|14[05-6]|15[5-6]|166|17[15-6]|18[5-6])\d{8})$)|(^(170[47-9]\d{7})$)`
//telcomexp:=`(^((133|149|153|17[37]|18[0-19]|199)\d{8})$)|(^((170[0-2]|1349|1410)\d{7})$)|(^(1740[0-5]\d{6})$)`
reg := regexp.MustCompile(mobileexp)
ok:=reg.MatchString("17046988981")
if ok {
println("china mobile")
}else {
println("NOT china mobile")
}
}
附表