stiefels.net Just another WordPress weblog

15Sep/070

Wincent Colaitua on Functional Programming

[Wincent Colaitua](http://www.wincent.com) has written an [interesting, worth reading blog post](http://wincent.com/a/about/wincent/weblog/archives/2007/09/why_functional.php) why functional programming could become more and more important in the future.

Note to myself: Have a deeper look at [Haskell](http://www.haskell.org).

10Sep/070

Full Perl-Compatible Regular Expressions in Objective-C

A few months ago I wrote about a mechanism which allowed simple [Pattern Matching with NSPredicate](http://www.stiefels.net/2007/01/24/regular-expressions-for-nsstring/).
Although it is a good method to check if a string matches a Regular Expression it lacks a lot of features you normally expect while you're doing something with Regular Expressions, such as capturing subpatterns or doing search and replace.

[Philip Hazel](http://www.uit.co.uk/exim-book/author-bio.htm) (who also wrote my favourite SMTP server, [Exim](http://www.exim.org) created a library called [PCRE (Perl-Compatible Regular Expressions)](http://www.pcre.org) a long time ago which implements the Regular Expression syntax used in [Perl](http://www.uit.co.uk/exim-book/author-bio.htm) (sometimes I miss that time) for the C Programming Language.
While PCRE is great for doing Regular Expressions in C, it's usage with Objective-C is some kind of cumbersome as NSString objects must be converted to plain C strings and back again.

But recently John Engelhart released an alpha version of his PCRE-based [RegexKit framework](http://regexkit.sourceforge.net), which provides a sweet object-oriented interface to Regular Expressions. It looks very mature and there is also a [very good documentation](http://regexkit.sourceforge.net/Documentation/index.html) available.

Thank you very much, John!