Please go through CoreData predicate: string property length?
or you can do like this
NSString *attributeName = @"name";
NSString *attributeValue = [NSString stringWithFormat:@".{%d}", 5];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K MATCHES %@", attributeName, attributeValue];
Reference - NSPredicate for an NSManagedObject's string attribute's length