NSMutableDictionary RegexKit Additions Reference

Extends by categoryNSMutableDictionary
RegexKit0.6.0 Release Notes
PCRE7.6
AvailabilityAvailable in Mac OS X v10.4 or later.
Declared in
  • RegexKit/NSDictionary.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

Adding Entries
Removing Entries

Instance Methods

Adds to the receiver the entries from otherDictionary whose keys are matched by aRegex.
- (void)addEntriesFromDictionary:(id)otherDictionary withKeysMatchingRegex:(id)aRegex;
Parameters
  • otherDictionary
    The dictionary from which to add entries.
  • aRegex
    A regular expression string or RKRegex object.
Discussion
Does nothing if none of the otherDictionary keys are matched by aRegex.
Adds to the receiver the entries from otherDictionary whose objects are matched by aRegex.
- (void)addEntriesFromDictionary:(id)otherDictionary withObjectsMatchingRegex:(id)aRegex;
Parameters
  • otherDictionary
    The dictionary from which to add entries.
  • aRegex
    A regular expression string or RKRegex object.
Discussion
Does nothing if none of the otherDictionary objects are matched by aRegex.
Removes from the receiver the entries whose keys are matched by aRegex.
- (void)removeObjectsForKeysMatchingRegex:(id)aRegex;
Discussion
Does nothing if none of the receivers keys are matched by aRegex.
Removes from the receiver the entries whose objects are matched by aRegex.
- (void)removeObjectsMatchingRegex:(id)aRegex;
Discussion
Does nothing if none of the receivers objects are matched by aRegex.
 
RegexKit project hosted by: