この単純な正規表現に関するヒントが必要です。
<img src ="..."/>から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];
それが何かと関係があるかどうかわからない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);
これで、グループだけでなく、それ以降のすべてが終了タグまで返されるため、出力は予期しないものになります。
出力
/sites/default/files/mypic.gif" style="width: 300px; height: 195px;