View Single Post
Hmm. This seems like a bug. Maybe we should change OFRegularExpressionMatch to fix it.

Meanwhile, the way that you could do it in your code is to use OFRegularExpression's -matchInString:range: method to loop through matches like so:

OFRegularExpression *expression; // the expression
NSString *string; // string searching through
NSRange searchRange = NSMakeRange(0, [string length]);
OFRegularExpressionMatch *match;

while ((match = [expression matchInString:string range:searchRange])) {
// do whatever you want with the match, then
searchRange.location = [match matchRange].location + 1;
searchRange.length = [string length] - searchRange.location;
}

Hope this helps!