RKL: Need API to that returns ranges, instead of strings
Status: Beta
Brought to you by:
jengelhart
It would be great to have an API similar to captureComponentsMatchedByRegex:range:, but which returns the results as NSRanges rather than strings.
I find myself in the situation of having to call rangeOfRegex:inRange:, in order to determine where the match occurred, followed by captureComponentsMatchedByRegex:range: to determine the captures from that match.
I am iteratively traversing a string looking for matches, processing the captures, and then looking for the next match. I have to track the position of the match because I also have to process the text before and after the match.
I guess this is a similar request to 2875906. And it could be implemented nicely by making this an option flag (as also suggested in 287590) that would return arrays of NSValues representing NSRange, instead of NSStrings, so that your API set wouldn't balloon out too much.
Hmm. This sourceforge project setup confuses me. This is a feature request for RegexKitLite, if that's not clear.