Menu

New Release - RegexKitLite 2.0

New features:

The ability to split a string in to a NSArray with a regular expression.

Search and replace using common $n capture substitution in the replacement string.

Support for Leopards Garbage Collection

Changes:

A new compile time configuration option, RKL_FAST_MUTABLE_CHECK, enables the use of a private, non-public Core Foundation function to determine if the string that will be searched is immutable. This allows many of the mutation safety checks to be skipped for that string and can significantly improve the performance of repeated matches on the same immutable NSString. For safety, this option is disabled by default.

Gives a warning at compile time if the minimum Mac OS X target is < 10.3, which is the first version that shipped with the ICU library.

Compile time tunable setting of how much of the stack can be used before switching to heap based storage. Changed by setting RKL_STACK_LIMIT to the maximum number of bytes to use from the stack. Defaults to 131072, or 128Kbytes. By default in Cocoa the main thread has a stack size of 8Mbytes and additional threads have a stack size of 512Kbytes.

New NSException name for RegexKitLite specific exceptions, RKLICURegexException.

Garbage Collection is safe to use in "mixed-mode" Garbage Collection applications. When compiled with Garbage Collection support (-fobjc-gc), RegexKitLite will dynamically select either Garbage Collection or manual memory management at run-time depending on whether or not Garbage Collection is enabled and active.

New NSString Methods:

- (NSArray *)componentsSeparatedByRegex:(NSString *)regex;
- (NSString *)stringByReplacingOccurrencesOfRegex:(NSString *)regex withString:(NSString *)replacement;

New NSMutableString Methods:

- (NSUInteger)replaceOccurrencesOfRegex:(NSString *)regex withString:(NSString *)replacement;

Posted by John Engelhart 2008-07-07

Log in to post a comment.