NSSet RegexKit Additions Reference

Extends by categoryNSSet
RegexKit0.6.0 Release Notes
PCRE7.6
AvailabilityAvailable in Mac OS X v10.4 or later.
Declared in
  • RegexKit/NSSet.h
Overview

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:.

Important:
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.

Tasks

Deriving New Sets
Querying a Set

Instance Methods

Returns one of the objects in the receiver, or nil if the receiver contains no objects matching aRegex.
- (id)anyObjectMatchingRegex:(id)aRegex;
Return Value
One of the objects in the receiver, or nil if the receiver contains no objects matching aRegex. The object returned is chosen at the receiver's convenience- the selection is not guaranteed to be random.
Returns a Boolean value that indicates whether an object matching aRegex is present in the receiver.
- (BOOL)containsObjectMatchingRegex:(id)aRegex;
Returns the number of objects matching aRegex in the receiver.
- (RKUInteger)countOfObjectsMatchingRegex:(id)aRegex;
Returns a new set that contains all the objects in the receiver matching aRegex.
- (NSSet *)setByMatchingObjectsWithRegex:(id)aRegex;
Return Value
Returns a set with a count of 0 if there are no matches.
 
RegexKit project hosted by: