Apples documentation of Regular Expressions With NSPredicate
has the full scoop, but basically you do
[NSPredicate predicateWithFormat:@"SELF MATCHES regex-here"];
. Unfortunately, you can only test if strings match a regex. You can not use an NSPredicate
-regex to extract parts of a string. Depending on what you need to do, this may or may not be enough to save the day.