NSMutableArray RegexKit Additions Reference

Extends by categoryNSMutableArray
RegexKit0.6.0 Release Notes
AvailabilityAvailable in Mac OS X v10.4 or later.
Declared in
  • RegexKit/NSArray.h

Specifying a Regular Expression

When specifying a regular expression, the regular expression can be either a RKRegex object or a NSString containing the text of a regular expression. When specified as a NSString, as determined by sending isKindOfClass:, the receiver will convert the string to a RKRegex object via regexWithRegexString:options:.

The method will raise NSInvalidArgumentException if the regular expression is nil. If passed as a NSString, the method will raise RKRegexSyntaxErrorException if the regular expression is not valid.

Determining if an Object Matches a Regular Expression

Objects are sent isMatchedByRegex: to determine whether or not they are matched by the specified regular expression.


Adding Objects
Removing Objects

Instance Methods

Adds the objects matching aRegex contained in otherArray to the end of the receiver's content.
- (void)addObjectsFromArray:(NSArray *)otherArray matchingRegex:(id)aRegex;
  • otherArray
    An array to search for objects matching aRegex to add to the end of the receiver's content.
  • aRegex
    A regular expression string or RKRegex object.
Removes all objects that match aRegex from the receiver.
- (void)removeObjectsMatchingRegex:(id)aRegex;
Removes all objects matching aRegex within range from the receiver.
- (void)removeObjectsMatchingRegex:(id)aRegex inRange:(const NSRange)range;
RegexKit project hosted by: