Hello, I have the following code:
NSString *text = @"http://bit.ly/111 http://bit.ly/222 http://www.www.www";
NSRegularExpression *aLinkRegex = [NSRegularExpression regularExpressionWithPattern:@".*http://.*" options:NSRegularExpressionCaseInsensitive error:nil];
NSUInteger numberOfMatches = [aLinkRegex numberOfMatchesInString:text options:0 range:NSMakeRange(0, [text length])];
I want to find the number of http's in the text (I know this isn't a good regex), but numberOfMatchesInString always returns 1, while it should return 3 in the above code.
Could someone please tell me what's wrong with the above code?
Cheers,