-findAllInString:
-findAllInString:range:
-findEnumeratorInString:
-findEnumeratorInString:range:
-findInString:
-findInString:range:
-initWithPattern:
-initWithPattern:options:
+regexWithPattern:
+regexWithPattern:options:
-replaceWithString:inString:
-replaceWithString:inString:limit:
-splitString:
-splitString:limit:

findAllInString:


- (NSArray *)findAllInString:(NSString *)str; 
Discussion

Calls findAllInString:range: using the full range of the target string.


findAllInString:range:


- (NSArray *)findAllInString:(NSString *)str range:(NSRange)r; 
Discussion

Returns an array of all non-overlapping occurrences of the regex in the given range of the target string. The members of the array are FSRegexMatches.


findEnumeratorInString:


- (NSEnumerator *)findEnumeratorInString:(NSString *)str; 
Discussion

Calls findEnumeratorInString:range: using the full range of the target string.


findEnumeratorInString:range:


- (NSEnumerator *)findEnumeratorInString:(NSString *)str 
        range:(NSRange)r; 
Discussion

Returns an enumerator for all non-overlapping occurrences of the regex in the given range of the target string. The objects returned by the enumerator are FSRegexMatches.


findInString:


- (FSRegexMatch *)findInString:(NSString *)str; 
Discussion

Calls findInString:range: using the full range of the target string.


findInString:range:


- (FSRegexMatch *)findInString:(NSString *)str range:(NSRange)r; 
Discussion

Returns an FSRegexMatch for the first occurrence of the regex in the given range of the target string or nil if none is found.


initWithPattern:


- (id)initWithPattern:(NSString *)pat; 
Discussion

Initializes the regex using the given pattern string. Returns nil if the pattern string is invalid.


initWithPattern:options:


- (id)initWithPattern:(NSString *)pat options:(int)opts; 
Discussion

Initializes the regex using the given pattern string and option flags. Returns nil if the pattern string is invalid.


regexWithPattern:


+ (id)regexWithPattern:(NSString *)pat; 
Discussion

Creates a new regex using the given pattern string. Returns nil if the pattern string is invalid.


regexWithPattern:options:


+ (id)regexWithPattern:(NSString *)pat options:(int)opts; 
Discussion

Creates a new regex using the given pattern string and option flags. Returns nil if the pattern string is invalid.


replaceWithString:inString:


- (NSString *)replaceWithString:(NSString *)rep inString:(NSString *)str; 
Discussion

Calls replaceWithString:inString:limit: with no limit.


replaceWithString:inString:limit:


- (NSString *)replaceWithString:(NSString *)rep inString:(NSString *)str 
        limit:(int)limit; 
Discussion

Returns the string created by replacing occurrences of the regex in the target string with the replacement string. If the limit is positive, no more than that many replacements will be made.

Captured subpatterns can be interpolated into the replacement string using the syntax $x or ${x} where x is the index or name of the subpattern. $0 and $& both refer to the entire pattern. Additionally, the case modifier sequences \U...\E, \L...\E, \u, and \l are allowed in the replacement string. All other escape sequences are handled literally.


splitString:


- (NSArray *)splitString:(NSString *)str; 
Discussion

Call splitString:limit: with no limit.


splitString:limit:


- (NSArray *)splitString:(NSString *)str limit:(int)lim; 
Discussion

Returns an array of strings created by splitting the target string at each occurrence of the pattern. If the limit is positive, no more than that many splits will be made. If there are captured subpatterns, they are returned in the array.

© Andrew Weinrich Last Updated: Wednesday, October 15, 2008