How to use NSPredicate to find an NSString begins with numbers or special characters in ios? -


could please help, how use nspredicate find nsstring beginswith numbers or other special characters (but not begin alphabets)? want sort array name contains numbers , special characters. advance help.

you should able use matches keyword:

[nspredicate predicatewithstring:@"self matches [^a-za-z]+.*"] 

you can find more docu here:

https://developer.apple.com/library/mac/documentation/cocoa/conceptual/predicates/articles/psyntax.html#//apple_ref/doc/uid/tp40001795-215868

and definition of how define regex here:

http://userguide.icu-project.org/strings/regexp


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -