/*Mailbox Verification MODIFIED by Helensong*/-(BOOL) Isvalidateemail: (NSString *) email{NSString*emailregex =@"[a-z0-9a-z._%+-]+@[a-za-z0-9.-]+\\. [A-za-z] {2,4}"; Nspredicate*emailtest = [Nspredicate predicatewithformat:@"Self MATCHES%@", Emailregex]; return[Emailtest evaluatewithobject:email];}/*Mobile number Verification MODIFIED by Helensong*/-(BOOL) Isvalidatemobile: (NSString *) mobile{//phone number starts with 13, 15, 18, eight \d numeric charactersNSString *phoneregex =@"^ ((13[0-9)) | ( 15[^4,\\D]) | (18[0,0-9])) \\d{8}$"; Nspredicate*phonetest = [Nspredicate predicatewithformat:@"Self MATCHES%@", Phoneregex];//NSLog (@ "Phonetest is%@", phonetest); return[Phonetest evaluatewithobject:mobile];}/*License plate number verification MODIFIED by Helensong*/BOOL Validatecarno (nsstring*Carno) {NSString*carregex =@"^[a-za-z]{1}[a-za-z_0-9]{5}$"; Nspredicate*cartest = [Nspredicate predicatewithformat:@"Self MATCHES%@", Carregex]; NSLog (@"Cartest is%@", cartest); return[Cartest Evaluatewithobject:carno];}
IOS judgment Mailbox, phone method