r/programming • • Aug 05 '08

Macs make programmers

http://kuoi.com/~kamikaze/read.php?id=200
0 Upvotes

174 comments sorted by

View all comments

Show parent comments

-1

u/dreamlax Aug 06 '08

Have a look at the NSPredicate class, and NSComparisonPredicate subclass. Not as intuitive as the Regex classes in .NET but having said that, they can do a lot more than just regular expressions.

2

u/cosmo7 Aug 06 '08

I just looked at NSPredicate and NSComparisonPredicate with high hopes, but still didn't find any regex support. They do support 'expressions', but not regular expressions.

It's really quite odd for cocoa to not do regex; you'd expect something like:

NSArray * matches = [some_string match: '/(.*)?/' withFlags: 'i'];

(Sorry if my Obj-C rusty.)