stringByReplacingOccurrencesOfRegex doc bug
Status: Beta
Brought to you by:
jengelhart
The documentation for:
stringByReplacingOccurrencesOfRegex:withString:options:range:error:
finished with:
"A NSString containing the substring of the receiver matched by capture number capture of regex within range of the receiver."
However this has been copied from elsewhere since the method does not include anything related to "capture".
Also, it is unclear from the documentation whether the range simply restricts the search&replace area, or limits the entire return string.
For example:
[@"hello" stringByReplacingOccurrencesOfRegex:@"xxx" withString:@"yyy" options:0 range:NSMakeRange( 1,2 ) error:nil]
does it return @"hello" or does it return @"el"?
This has been fixed in the 3.0 documentation.