Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/110.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MWFeedParser正在删除嵌入式媒体URL-iOS_Ios_Objective C_Rss - Fatal编程技术网

MWFeedParser正在删除嵌入式媒体URL-iOS

MWFeedParser正在删除嵌入式媒体URL-iOS,ios,objective-c,rss,Ios,Objective C,Rss,我有以下url的页面源信息,如下所示: img src='1〕http://images.thecarconnection.com/tmb/2013-porsche-panamera-platinum-edition_100405984_t.gif保时捷以其传奇的双门跑车而闻名,近年来,保时捷已将业务拓展到SUV和轿车领域。该公司的首款四门车保时捷Panamera,以其非传统风格和卓越性能的融合,赢得了人们的赞誉和追捧。虽然Panamera系列产品范围广泛,但它与……img src=”竞争ht

我有以下url的页面源信息,如下所示:

img src='1〕http://images.thecarconnection.com/tmb/2013-porsche-panamera-platinum-edition_100405984_t.gif保时捷以其传奇的双门跑车而闻名,近年来,保时捷已将业务拓展到SUV和轿车领域。该公司的首款四门车保时捷Panamera,以其非传统风格和卓越性能的融合,赢得了人们的赞誉和追捧。虽然Panamera系列产品范围广泛,但它与……img src=”竞争http://feeds.feedburner.com/~r/thecarconnection/porsche/~4/_LggPvmEzJ4“height=“1”width=“1”/

我想删除“img src=”http://images.thecarconnection.com/tmb/2013-porsche-panamera-platinum-edition_100405984_t.gif描述中的“”链接。我正在使用MWFeedParser,它将解析URL作为描述的一部分。关于如何删除描述标记中的链接,您有什么建议吗?

您可以使用
NSRegularExpression
尝试使用此代码段:

NSString *description = ...;
NSError *error = NULL;

NSRegularExpression *regex = [NSRegularExpression
        regularExpressionWithPattern:@"\\<img src='[^']*' */\\>"
        options:NSRegularExpressionCaseInsensitive error:&error];

NSString *modifiedDescription = [regex stringByReplacingMatchesInString:description
           options:0
           range:NSMakeRange(0, [description length])
           withTemplate:@""];
NSString *description = ...;
NSError *error = NULL;

NSRegularExpression *regex = [NSRegularExpression
        regularExpressionWithPattern:@"\\<img src='[^']*' */\\>"
        options:NSRegularExpressionCaseInsensitive error:&error];

NSString *modifiedDescription = [regex stringByReplacingMatchesInString:description
           options:0
           range:NSMakeRange(0, [description length])
           withTemplate:@""];