I have to find number in NSString using NSPredicate. I am using following code.
NSString *test = @"[0-9]";
NSString *testString = @"ab9";
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(%@ CONTAINS[c] %@)", test,testString];
BOOL bResult = [predicate evaluateWithObject:testString];
This code is searching for number at only start. I have also tried with @"[0-9]+" and @"[0-9]*" theses expressions but not getting correct result.