标签:io ar art html amp log htm ad
NSError *error = NULL;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(<img\\s[\\s\\S]*?src\\s*?=\\s*?[‘\"](.*?)[‘\"][\\s\\S]*?>)+?"
options:NSRegularExpressionCaseInsensitive
error:&error];
[regex enumerateMatchesInString:_article.htmlContent
options:0
range:NSMakeRange(0, [_article.htmlContent length])
usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) {
NSString *img = [_article.htmlContent substringWithRange:[result rangeAtIndex:2]];
NSLog(@"img src %@",img);
if ([img rangeOfString:@"share_btn"].location == NSNotFound) {
[_imagesArray addObject:img];
}
}];
标签:io ar art html amp log htm ad
原文地址:http://www.cnblogs.com/zengyanzhi/p/3921305.html