4 karma · joined Feb 4, 2011 (15y ago) · 3 submissions
comment 15y ago · link · parent
Me being vastly more productive. Extract all the http like URL's from a string and print them:
for(id match in [searchString componentsMatchedByRegex:@"\\bhttps?://[a-zA-Z0-9\\-.]+(?:(?:/[a-zA-Z0-9\\-._?,'+\\&%$=~*!():@\\\\]*)+)?"]) {
printf("URL: %s\n", [match UTF8String]);
}
I dare you, I double dog dare you to do the same thing in three lines of code with C and PCRE.comment 15y ago · link · parent
comment 15y ago · link · parent
So, in short, it's possible to write a very high performance JSON serializer and deserializer in ObjC in ~2K lines of code. For JSONKit, most it is actually pure C (which in turn uses Core Foundation, which is a pure C API interface version for the equivalent native ObjC objects), with public API ObjC stub bindings making use of the C code.