NSObject RegexKit Additions Reference
PCRE7.6
AvailabilityAvailable in Mac OS X v10.4 or later.
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:.
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
Instance Methods
Returns any regular expression from regexArray that matches the receiver.
- (
RKRegex *)anyMatchingRegexInArray:(NSArray *)regexArray;
-
regexArray
A
NSArray containing either regular expression strings or
RKRegex objects.
Returns one of the regular expressions from regexArray that matches the receiver, or NULL if the receiver is not matched by any of the regular expressions or an error occurs. The object returned is chosen at the receiver's convenience- the selection is not guaranteed to be random.
Returns any regular expression from regexArray that matches the receiver using the regular expression library and libraryOptions, setting the optional error parameter if an error occurs.
- (
RKRegex *)anyMatchingRegexInArray:(NSArray *)regexArray library:(NSString *)library options:(
RKCompileOption)libraryOptions error:(NSError **)error;
regexArray may contain either regular expression strings or
RKRegex objects. See
Regular Expression Libraries for a list of valid
library constants. If information about any errors is not required,
error may be set to
NULL.
Returns one of the regular expressions from regexArray that matches the receiver, or NULL if the receiver is not matched by any of the regular expressions or an error occurs. The object returned is chosen at the receiver's convenience- the selection is not guaranteed to be random.
Returns any regular expression from regexSet that matches the receiver.
- (
RKRegex *)anyMatchingRegexInSet:(NSSet *)regexSet;
-
regexSet
A
NSSet containing either regular expression strings or
RKRegex objects.
Returns one of the regular expressions from regexSet that matches the receiver, or NULL if the receiver is not matched by any of the regular expressions or an error occurs. The object returned is chosen at the receiver's convenience- the selection is not guaranteed to be random.
Returns any regular expression from regexSet that matches the receiver using the regular expression library and libraryOptions, setting the optional error parameter if an error occurs.
- (
RKRegex *)anyMatchingRegexInSet:(NSSet *)regexSet library:(NSString *)library options:(
RKCompileOption)libraryOptions error:(NSError **)error;
See
Regular Expression Libraries for a list of valid
library constants. If information about any errors is not required,
error may be set to
NULL.
regexSet may contain either regular expression strings or
RKRegex objects. Returns one of the regular expressions from
regexSet that matches the receiver, or
NULL if the receiver is not matched by any of the regular expressions or an error occurs. The object returned is chosen at the receiver's convenience- the selection is not guaranteed to be random.
Returns the first regular expression from regexArray that matches the receiver.
- (
RKRegex *)firstMatchingRegexInArray:(NSArray *)regexArray;
-
regexArray
A
NSArray containing either regular expression strings or
RKRegex objects.
Returns the first regular expression from regexArray that matches the receiver, or NULL if the receiver is not matched by any of the regular expressions or an error occurs.
Returns the first regular expression from regexArray that matches the receiver using the regular expression library and libraryOptions, setting the optional error parameter if an error occurs.
- (
RKRegex *)firstMatchingRegexInArray:(NSArray *)regexArray library:(NSString *)library options:(
RKCompileOption)libraryOptions error:(NSError **)error;
regexArray may contain either regular expression strings or
RKRegex objects. See
Regular Expression Libraries for a list of valid
library constants. If information about any errors is not required,
error may be set to
NULL.
Returns the first regular expression from regexArray that matches the receiver, or NULL if the receiver is not matched by any of the regular expressions or an error occurs.
Returns a Boolean value that indicates whether the receiver is matched by any regular expression in regexArray.
- (BOOL)isMatchedByAnyRegexInArray:(NSArray *)regexArray;
-
regexArray
A
NSArray containing either regular expression strings or
RKRegex objects.
Returns YES if the receiver is matched by any regular expression in regexArray, NO otherwise.
Returns a Boolean value that indicates whether the receiver is matched by any regular expression in regexArray using the regular expression library and libraryOptions, setting the optional error parameter if an error occurs.
- (BOOL)isMatchedByAnyRegexInArray:(NSArray *)regexArray library:(NSString *)library options:(
RKCompileOption)libraryOptions error:(NSError **)error;
regexArray may contain either regular expression strings or
RKRegex objects. See
Regular Expression Libraries for a list of valid
library constants. If information about any errors is not required,
error may be set to
NULL.
Returns YES if the receiver is matched by any regular expression in regexArray, NO otherwise.
Returns a Boolean value that indicates whether the receiver is matched by any regular expression in regexSet.
- (BOOL)isMatchedByAnyRegexInSet:(NSSet *)regexSet;
-
regexSet
A
NSSet containing either regular expression strings or
RKRegex objects.
Returns YES if the receiver is matched by any regular expression in regexSet, NO otherwise.
Returns a Boolean value that indicates whether the receiver is matched by any regular expression in regexSet using the regular expression library and libraryOptions, setting the optional error parameter if an error occurs.
- (BOOL)isMatchedByAnyRegexInSet:(NSSet *)regexSet library:(NSString *)library options:(
RKCompileOption)libraryOptions error:(NSError **)error;
regexSet may contain either regular expression strings or
RKRegex objects. See
Regular Expression Libraries for a list of valid
library constants. If information about any errors is not required,
error may be set to
NULL.
Returns YES if the receiver is matched by any regular expression in regexSet, NO otherwise.
Returns a Boolean value that indicates whether the receiver is matched by aRegex.
- (BOOL)isMatchedByRegex:(id)aRegex;
-
aRegex
A regular expression string or
RKRegex object.
Returns YES if the receiver is matched by aRegex, NO otherwise.