判断手机号

来源:互联网 发布:ubuntu amd双显卡切换 编辑:程序博客网 时间:2024/04/28 19:04
    private boolean isPhone(String phone, String pwd) {        if(TextUtils.isEmpty(phone)||TextUtils.isEmpty(pwd)){            Toast.makeText(context,"用户名或密码不能为空",Toast.LENGTH_LONG).show();            return false;        }else if(phone=="^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}$"){            Toast.makeText(context,"手机号格式不正确",Toast.LENGTH_LONG).show();            return false;        }        return true;    }

原创粉丝点击