Menu

#23 stringByReplacingOccurrencesOfRegex doc bug

RegexKitLite 2.2
closed-fixed
5
2009-05-02
2008-11-21
No

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"?

Discussion

  • John Engelhart

    John Engelhart - 2009-05-02

    This has been fixed in the 3.0 documentation.

     
  • John Engelhart

    John Engelhart - 2009-05-02
    • status: open --> closed-fixed
     

Log in to post a comment.