September 26, 2006

icu regex in cocoa

I do java server code for a living. It's my bread and butter. At home when I do my silly little math notes I play with haskell. That's my chocolate dessert. But sometimes I get a craving for something completely different. So in the last couple of weeks I've been hacking a cocoa app: my spicy Thai dish. I don't do it often but it's very tasty when I try it.

I needed a regex lib in this little cocoa app. There are regex packages available for cocoa (see CocoaDev). It seems though that Apple is using icu internally (you can guess that from the Predicates Programming Guide for example). I wanted to use that too. libicucore.dylib is on the system, compiled and ready to use. Unfortunately Apple doesn't provide the headers because the icu API is not final yet and Apple understandably doesn't want to commit to it yet.

So I downloaded the icu package that Apple uses and wrote my own obj-c wrappers for now until Apple officially exposes theirs. You can get the wrappers and a small how-to readme file from here. Use at your own risk.

Posted by Uwe Hoffmann at September 26, 2006 02:05 PM