In Objective-c, I want to check is a proper english sentence/word or not, not grammatically.. i.e: texts like "I didn't go!", ""Hi" is a word", "hello world", "a 5 digit number", "the % is high!" and "[email protected]" should pass. but texts like "@/-5%;l:" should NOT pass the text may contain: numbers 0-9 and letters a-z, A-Z and -/:;()$&\"'!?,._
I tried:
NSString *regex1 = @"^[\w:;()'\"\s-]*";
NSPredicate *streamTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex1];
return [streamTest evaluateWithObject:candidate];
But it wouldn't achieve what I want Any ideas?