#pragma mark determines the mailbox's
+ (BOOL) Isvalidateemail: (nsstring *) Email
{
NSString *emailregex = @ "[A-z0-9a-z._%+-][email protected][a-za-z0-9.-]+\\\\. [A-za-z] {2,4} ";
Nspredicate *emailtest = [Nspredicate predicatewithformat:@ "Self MATCHES%@", Emailregex];
return [Emailtest evaluatewithobject: email];
}
#pragma mark QQ number
+ (BOOL) validateqq: (nsstring *) Email
{
nsstring *emailregex = @ "^\\\\d{5,12}$";
Nspredicate *emailtest = [Nspredicate predicatewithformat:@ "Self MATCHES%@", Emailregex];
return [Emailtest evaluatewithobject: email];
}
#pragma Mark * * #
+ (BOOL) Validateidentitycard: (nsstring *) Identitycard
{
BOOL Flag;
if (Identitycard. length <= 0) {
Flag = NO;
return flag;
}
NSString *regex2 = @ "^ (\\\\d{14}|\\\\d{17}) (\\\\d|[ XX]) $ ";
nspredicate *identitycardpredicate = [nspredicate predicatewithformat:@ "Self MATCHES %@ ", Regex2];
return [Identitycardpredicate evaluatewithobject: Identitycard];
}
#pragma Mark judged his nickname.
+ (BOOL) Validatenickname: (nsstring *) Nickname
{
NSString *phoneregex = @ "[\\u4e00-\\u9fa5]{2,7}";
Nspredicate *phonetest = [Nspredicate predicatewithformat:@ "Self MATCHES%@", Phoneregex];
return [Phonetest evaluatewithobject: nickname];
}
Mobile phone number of the regular, almost all the Internet is not good use, there are bugs, so the proposal still judge mobile phone number 11, is not 1 beginning, I feel it can, can only be the number
This article is from the "11204872" blog, please be sure to keep this source http://11214872.blog.51cto.com/11204872/1755323
IOS Mailbox Judgment