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 -

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

Why does a .NET 4.0 program produce a system.unauthorizedAccess error on a Windows Server 2012 machine with .NET 4.5 installed? -