+ (BOOL) Validateemail: (NSString *) email
{
NSString *emailregex = @ "^[\\w-]+ (\\.[ \\w-]+) *@[\\w-]+ (\\.[ \\w-]+) +$ ";
Nspredicate *emailtest = [Nspredicate predicatewithformat:@ "Self MATCHES%@", Emailregex];
return [Emailtest Evaluatewithobject:email];
}
Mobile phone number Verification
+ (BOOL) Validatemobile: (NSString *) mobile
{
Phone number starts with 13, 15, 18, eight \d numeric characters
NSString *phoneregex = @ "^ ((13[0-9]) | ( 15[^4,\\D]) | (18[0,0-9])) \\d{8}$ ";
Nspredicate *phonetest = [Nspredicate predicatewithformat:@ "Self MATCHES%@", Phoneregex];
return [Phonetest Evaluatewithobject:mobile];
}
+ (BOOL) validateqq: (NSString *) QQ
{
NSString *qqregex = @ "^[0-9]{5,12}$";
Nspredicate *qqtest = [Nspredicate predicatewithformat:@ "Self MATCHES%@", Qqregex];
return [Qqtest EVALUATEWITHOBJECT:QQ];
}
Regular verification phone number QQ number and mailbox