As I mentioned (here), we're just wrapping a filtering routine up in a category on NSString. Here is the first part of the code file including the category:
In the code at the bottom of the post, we construct a "function expression" from the new NSString method. Two things really confused me. First, in the method
the "function" is the object itself. And the second thing was figuring out the format string for the predicate that wraps up our expression:
This is the output:
First we construct the expression and evaluate it. In the second part, we construct the predicate and use it to filter an array or just "evaluate" a string. Still to do: test it in an app with bindings and an NSTextField or NSTableView.