Up

# NSRegularExpression class documentation

### Authors

Generated by Debian

Version: 31371

Date: 2010-09-18 16:09:58 +0100 (Sat, 18 Sep 2010)

Copyright: (C) 2010 Free Software Foundation, Inc.

# Software documentation for the NSRegularExpression class

## NSRegularExpression : NSObject

> Declared in:
>   Foundation/NSRegularExpression.h

> Conforms to:
>   NSCoding
>   NSCopying

Availability: MacOS-X 10.0.0
NSRegularExpression is used to inspect and manipulate strings using regular expressions. The interface is thread safe: The same NSRegularExpression object may be used to concurrently perform matching on multiple threads. To guard against regular expressions with extremely poor performance, the underlying matcher will abort after a certain number of steps. This is controlled using the GSRegularExpressionWorkLimit user default. The value of this default key represents the number of steps executed by the match engine, so it is only indirectly correlated with the time taken to execute the pattern, but it usually in the order of milliseconds. The preset 1500, setting value to 0 disables the work limit.
Method summary

- +regularExpressionWithPattern:options:error:
- -enumerateMatchesInString:options:range:usingBlock:
- -firstMatchInString:options:range:
- -initWithPattern:options:error:
- -matchesInString:options:range:
- -numberOfCaptureGroups
- -numberOfMatchesInString:options:range:
- -options
- -pattern
- -rangeOfFirstMatchInString:options:range:
- -replaceMatchesInString:options:range:withTemplate:
- -replacementStringForResult:inString:offset:template:
- -stringByReplacingMatchesInString:options:range:withTemplate:

### regularExpressionWithPattern: options: error:

+ (NSRegularExpression*) regularExpressionWithPattern: (NSString*)aPattern options: (NSRegularExpressionOptions)opts error: (NSError**)e;
Availability: MacOS-X 10.0.0
Description forthcoming.

### enumerateMatchesInString: options: range: usingBlock:

- (void) enumerateMatchesInString: (NSString*)string options: (NSMatchingOptions)opts range: (NSRange)range usingBlock: (GSRegexBlock)block;
Availability: MacOS-X 10.0.0
Description forthcoming.

### firstMatchInString: options: range:

- (NSTextCheckingResult*) firstMatchInString: (NSString*)string options: (NSMatchingOptions)opts range: (NSRange)range;
Availability: MacOS-X 10.0.0
Description forthcoming.

### initWithPattern: options: error:

- (id) initWithPattern: (NSString*)aPattern options: (NSRegularExpressionOptions)opts error: (NSError**)e;
Availability: MacOS-X 10.0.0
Description forthcoming.

### matchesInString: options: range:

- (NSArray*) matchesInString: (NSString*)string options: (NSMatchingOptions)opts range: (NSRange)range;
Availability: MacOS-X 10.0.0
Description forthcoming.

### numberOfCaptureGroups

- (NSUInteger) numberOfCaptureGroups;
Availability: MacOS-X 10.0.0
Description forthcoming.

### numberOfMatchesInString: options: range:

- (NSUInteger) numberOfMatchesInString: (NSString*)string options: (NSMatchingOptions)opts range: (NSRange)range;
Availability: MacOS-X 10.0.0
Description forthcoming.

### options

- (NSRegularExpressionOptions) options;
Availability: MacOS-X 10.0.0
Description forthcoming.

### pattern

- (NSString*) pattern;
Availability: MacOS-X 10.0.0
Description forthcoming.

### rangeOfFirstMatchInString: options: range:

- (NSRange) rangeOfFirstMatchInString: (NSString*)string options: (NSMatchingOptions)opts range: (NSRange)range;
Availability: MacOS-X 10.0.0
Description forthcoming.

### replaceMatchesInString: options: range: withTemplate:

- (NSUInteger) replaceMatchesInString: (NSMutableString*)string options: (NSMatchingOptions)opts range: (NSRange)range withTemplate: (NSString*)template;
Availability: MacOS-X 10.0.0
Description forthcoming.

### replacementStringForResult: inString: offset: template:

- (NSString*) replacementStringForResult: (NSTextCheckingResult*)result inString: (NSString*)string offset: (NSInteger)offset template: (NSString*)template;
Availability: MacOS-X 10.0.0
Description forthcoming.

### stringByReplacingMatchesInString: options: range: withTemplate:

- (NSString*) stringByReplacingMatchesInString: (NSString*)string options: (NSMatchingOptions)opts range: (NSRange)range withTemplate: (NSString*)template;
Availability: MacOS-X 10.0.0
Description forthcoming.

Up