Reputation: 2636
Could you please help, how to use NSPredicate to find an NSString beginsWith numbers or other special characters (But not begin with alphabets)? I want to sort an array name that contains any numbers and special characters. Advance thanks for help.
Upvotes: 0
Views: 589
Reputation: 4331
You should be able to use the MATCHES
keyword:
[NSPredicate predicateWithString:@"self MATCHES [^a-zA-Z]+.*"]
You can find more docu here:
and the definition of how to define the regex here:
http://userguide.icu-project.org/strings/regexp
Upvotes: 2