String regex="(13[4-9]|15[01789]|18[78])\\d{8}";
if(str.matches(regex)){
    System.out.println(str+"是一个移动号");
}

解决方案 »

  1.   

    如果不用正则可以自己判断一下。
    使用indexOf函数   public static void main(String[] args){
    String str = "134,135,136,137,138,139,150,151,157,158,159,187,188";
    String s = "1235903";
    if(str.indexOf(s.substring(0,3))>=0){//是移动号码
    System.out.println("AAAAAAAAAAAA");
    }else{
    System.out.println("BBB");
    }
    }
      

  2.   

    public class Regular {
    public static void main(String[] args) { String match = "^1((3[4-9])|(5[0|1|7-9])|(8[7|8]))\\d*"; for (String s : tests) {
    if ( s.matches(match)) {
    System.out.println(s + " matches");
    } else {
    System.out.println(s + " does not match");
    }
    }
    } private static String[] tests = {
    "13112345678",
    "13212345678",
    "13312345678",
    "13412345678",
    "13512345678",
    "13612345678",
    "13712345678",
    "13812345678",
    "13912345678",
    "15012345678",
    "15112345678",
    "15212345678",
    "15312345678",
    "15412345678",
    "15512345678",
    "15612345678",
    "15712345678",
    "15812345678",
    "15912345678",
    "18112345678",
    "18212345678",
    "18312345678",
    "18412345678",
    "18512345678",
    "18612345678",
    "18712345678",
    "18812345678",
    "18912345678"
    };
    }
      

  3.   

    解决方法太多了。至少if else就是一个好方法。至于怎么存放,数据库,普通文件,配置文件都可以。你至少要先试一下吧?