Need some hints on this simple regexp.
Regexp and target string code for extracting src from < img src="..." />
NSString *imgTag = @"<img alt=\"\" src=\"/sites/default/files/mypic.gif\" style=\"width: 300px; height: 195px;\" />";
NSRegularExpression *a = [NSRegularExpression regularExpressionWithPattern:@"src=\"(.*)\"" options:NSRegularExpressionCaseInsensitive error:nil];
Not sure if it has something to do with the options
NSTextCheckingResult *matches = [a firstMatchInString:imgTag options:NSMatchingReportProgress range:NSMakeRange(0, [imgTag length])];
NSRange matchRange = [matches range];
NSString *src = [imgTag substringWithRange:matchRange];
NSLog(@"%s, %@", __PRETTY_FUNCTION__, src);
Now the output is unexpected since it returns not only the group, but also everything after it up to the end tag.
Output
/sites/default/files/mypic.gif" style="width: 300px; height: 195px;