FSRegexMatch |
A single occurence of a regular expression.
Superclass: NSObject
Declared In: FSRegex.h
An FSRegexMatch represents a single occurence of a regular expression within the target string. The range of each subpattern within the target string is returned by -range, -rangeAtIndex:, or -rangeNamed:. The part of the target string that matched each subpattern is returned by -group, -groupAtIndex:, or -groupNamed:.
count |
- (int)count;
The number of capturing subpatterns, including the pattern itself.
group |
- (NSString *)group;
Returns the part of the target string that matched the pattern.
groupAtIndex: |
- (NSString *)groupAtIndex:(int)idx;
Returns the part of the target string that matched the subpattern at the given index or nil if it wasn't matched. The subpatterns are indexed in order of their opening parentheses, 0 is the entire pattern, 1 is the first capturing subpattern, and so on.
groupNamed: |
- (NSString *)groupNamed:(NSString *)name;
Returns the part of the target string that matched the subpattern of the given name or nil if it wasn't matched.
range |
- (NSRange)range;
Returns the range of the target string that matched the pattern.
rangeAtIndex: |
- (NSRange)rangeAtIndex:(int)idx;
Returns the range of the target string that matched the subpattern at the given index or {NSNotFound, 0} if it wasn't matched. The subpatterns are indexed in order of their opening parentheses, 0 is the entire pattern, 1 is the first capturing subpattern, and so on.
rangeNamed: |
- (NSRange)rangeNamed:(NSString *)name;
Returns the range of the target string that matched the subpattern of the given name or {NSNotFound, 0} if it wasn't matched.
string |
- (NSString *)string;
Returns the target string.
© Andrew Weinrich Last Updated: Wednesday, October 15, 2008