The matches should be returned in order. 

Douglas Davidson

On Aug 15, 2012, at 8:33 AM, Koen van der Drift <koenvanderdr...@gmail.com> 
wrote:

> I am using NSRegularExpression to search for certain words in a
> string.  To interrogate the results I use something like:
> 
> NSArray *matches = [regularExpression matchesInString: myString
> options:0 range: NSMakeRange(0, [myString length])];
> 
> for (NSTextCheckingResult *match in matches)
> {
>    NSRange matchRange = [match range];
>    NSUInteger  index = matchRange.location;
>    etc...
> }
> 
> Is there any guarantee that the matchRanges will be in order as they
> appear in the string? In other words, will the matches array be
> ordered when returned?
> 
> - Koen.
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/ddavidso%40apple.com
> 
> This email sent to ddavi...@apple.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to