views:

4201

answers:

4

Hi, I'm confused about the regex librarys that can be available for the iphone. For example RegexLite look like need a dinamyc link, nad as I understood this is not possible for the sdk on the iPhone.

I wanna a regex library for do data validation... which one is the best available?

+4  A: 

RegexKitLite is available and works properly on iPhone either included from source as part of your Xcode project or by linking in a static library (which the ToS of the SDK do permit).

wisequark
+3  A: 

Using RegexKitLite requires dragging only a source and header file into your project, and works really well - it offers most of the features you'd want from a regex library. It's basically just a very thin wrapper around an underlying framework that's already there.

Make sure the source type for header and .m file is "sourcecode.c.objc" after you add them to the project (Use "Get Info" on a given source file and look at the "General" tab).

Kendall Helmstetter Gelner
Reports are coming that iOS4 apps using RegexKitLite are being rejected supposedly due to violation of §3.3.1
glebd
This seems very unlikely given that it's a thin wrapper around the RegEx support built into the existing iPhone libraries. It would be rather like banning an app that used a UIWebView... Do you have a link with someone noting a rejection on those grounds? Google found nothing except speculation.You may possibly be confused by someone who used RegexKitLite to parse a custom language script. But for something like that you could probably get approval (note that 3.3.1 has been revised to allow you to seek an exception).
Kendall Helmstetter Gelner
Link further down on the page on @bonaldi's answer
Ross
+1  A: 

RegexKitLite uses the regular expression engine provided by the libicucore.A.dylib library. However Apple does not officially support linking directly against this library. See this post to the Xcode-users mailing list for details. However despite this there are many iPhone applications available on the App Store than make use of RegexKitLite, so it's unlikely (but not impossible) that Apple will reject your application for making use of it.

Alasdair Allan
+6  A: 

John Englehart (regexkitlite developer) has posted to cocoa-dev saying that apps are being rejected for using it. http://lists.apple.com/archives/Cocoa-dev/2010/Jun/msg00564.html

(Apologies for this purporting to be an "answer", it would be a reply to Kendall Helmstetter Gelner if only I had 49 more reputation points).

bonaldi
thanks for passing this info on.
Ross
Interesting, the NDA is lifted now so does anyone have any clearer description? The only speculation I could find was they considered the ICU stuff to be private APIs...
Kendall Helmstetter Gelner
It looks like the issue is probably resolved. See this followup from the developer.http://www.cocoabuilder.com/archive/cocoa/288966-update-applications-using-regexkitlite-no-longer-being-accepted-at-the-appstore.html#289872
Jacques