Capture groups not working in NSRegularExpression
You will access the first group range using : for (NSTextCheckingResult *match in matches) { //NSRange matchRange = [match range]; NSRange matchRange = [match rangeAtIndex:1]; NSString *matchString = [htmlString substringWithRange:matchRange]; NSLog(@”%@”, matchString); }