Skip to content

RegexKitLite 5.0 Migration

Compare
Choose a tag to compare
@samkrishna samkrishna released this 15 Nov 14:31
· 543 commits to master since this release

This first release includes an almost pure clone of the the RegexKitLite 4.0 ("RKL4") Objective-C API from John Engelhart. This version includes:

  • Exposing NSMatchingOptions on the most argument-rich API call (not required to be used)
  • Use of NSNotFound as the error return code if an API returning NSUInteger doesn't match the regex
  • Use of proper NSArray collections for the block-based methods
  • All code is ARC-compliant
  • The Objective-C API is 100% Analyzer Approved!!
  • Cursory tests demonstrating how to use each of the APIs
  • Deprecated RKLRegexEnumerationOptions
  • Deprecated all the RKLICURegex...Error keys

NOTE: If you use any of the block-based methods from RKL4, you'll need to update your code at the block signature level. Specifically, you'll need to convert the RKL4 API blocks from this kind of block signature:

- (BOOL)enumerateStringsMatchedByRegex:(NSString *)regex 
                            usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;

to this kind of block signature:

- (BOOL)enumerateStringsMatchedByRegex:(NSString *)pattern 
                            usingBlock:(void (^)(NSArray<NSString *> *capturedStrings, NSArray<NSValue *> *capturedRanges, BOOL *stop))block;

It's a small conversion to NSUInteger and NSArray for the captureCount and capturedStrings block arguments.