Instance Method

replaceMatchesInString:options:range:withTemplate:

Replaces regular expression matches within the mutable string using the template string.

Declaration

- (NSUInteger)replaceMatchesInString:(NSMutableString *)string options:(NSMatchingOptions)options range:(NSRange)range withTemplate:(NSString *)templ;

Parameters

string

The mutable string to search and replace values within.

options

The matching options to use. See NSMatchingOptions for possible values.

range

The range of the string to search.

template

The substitution template used when replacing matching instances.

Return Value

The number of matches.

Discussion

See Flag Options for the format of template.

See Also

Replacing Strings Using Regular Expressions

- stringByReplacingMatchesInString:options:range:withTemplate:

Returns a new string containing matching regular expressions replaced with the template string.