iphone 常用校驗表單

2021-06-08 00:23:13 字數 990 閱讀 1295

1、判斷使用者名稱,在2-16位

-(bool)checkinput:(nsstring *)_text

$"; nspredicate *emailtest = [nspredicate predicatewithformat:@"self matches %@", regex];

return [emailtest evaluatewithobject:_text];

}

2、判斷手機號碼,1開頭的十一位數字

-(bool)checkinput:(nsstring *)_text

"; nspredicate *emailtest = [nspredicate predicatewithformat:@"self matches %@", regex];

return [emailtest evaluatewithobject:_text];

}

3、判斷郵箱

-(bool)checkinput:(nsstring *)_text

"; nspredicate *emailtest = [nspredicate predicatewithformat:@"self matches %@", regex];

return [emailtest evaluatewithobject:_text];

}

4、判斷密碼,6-16位

-(bool)checkinput:(nsstring *)_text

"; nspredicate *emailtest = [nspredicate predicatewithformat:@"self matches %@", regex];

return [emailtest evaluatewithobject:_text];

}

開發常用 校驗表單 賬號的校驗

要求 必填,僅支援數字字母下劃線組合,不支援特殊字元,賬號長度應為6 20 html js 引入 validate.js import validate from utils validate validate.js檔案內容 檢查賬號是否合法,只允許字母數字下劃線組合 function checka...

開發常用 校驗表單 密碼的校驗

要求 必填,密碼應為8 20位字元,必須包含數字 字母 下劃線中的兩種以上 validate.js檔案內容 檢查密碼是否合法 function checkpwd userpassword if userpassword.length 20 userpassword.length 8 if 0 9 g...

iphone 註冊校驗(正則)

最近在做使用者管理程式,在做的過程中使用者註冊資訊校驗在網上查了好久,沒查到現成的 只能自己寫了,放在這裡,有需要直接拿去。自己也做備份,以後使用方便。校驗使用者名稱 bool validateusername nsstring str a za z0 9 u4e00 u9fa5 w u4e00 u...