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.
September 20, 2008
Regex Matching and Filtering in Cocoa With NSPredicate
No Comments »
No comments yet.
RSS feed for comments on this post.