public boolean isMobile(String str){
        str = str.trim();
        String pattern = "^[1][3][0-9]{9}";
        return str.matches(regex);
}

解决方案 »

  1.   

    public boolean isMobile(String str){
            str = str.trim();
            String regex= "^13\\d{9}$
            return str.matches(regex);
    }
      

  2.   

    Pattern p = Pattern.compile("13[0123][0-9]{8}");//手机号码的正则表达式
    Matcher mm = p.matcher(sjh);
    if(mm.matches())
    {
    联通;
    }
    else
    {
    移动;
    }
      

  3.   

    Pattern p = Pattern.compile("13[0123][0-9]{8}");//手机号码的正则表达式你这个只是联通的
      

  4.   

    同意~congliu(取次花丛都不顾,半缘修道半缘君。)
      

  5.   

    多谢各位,有没有在jsp里判断的
      

  6.   

    在JSP里面跟在JAVA里面判断不都一样的吗?
    照样可以写函数的!
      

  7.   

    JSP里面函数写在
    <%!%>
    里面
      

  8.   

    正则表达式中文http://www.yesky.com/428/1706928.shtml