PCRE for iPhone

Lately, I’ve been working on a project requiring heavy use of regular expressions on Cocoa. Foundation frameworks do not offer built in support for regular expressions. Instead, they do heavy work using NSScanner, and NSPredicate classes.

 A framework was created to solve this problem, called RegexKitLite, but it’s heavy use of and linking to Apple’s internal ICU framework, makes it very dangerous to App Store Rejection, when talking about applications for iPhone.

So, I’ve been searching for something like PCRE for iPhone, and I couldn’t find it anywhere. Therefore, I downloaded, and compiled the famous and standard PCRE library for  the iPhone as a dylib. I know that for some of you this can be a difficult process, so I will describe the steps here.

Continue reading