IOS使用正则表达式去掉html中的标签元素,获得纯文本
作者:
ArsonQ | 来源:发表于
2016-08-23 23:07 被阅读0次//正则去除网络标签
-(NSString *)getZZwithString:(NSString *)string{
NSRegularExpression *regularExpretion=[NSRegularExpression regularExpressionWithPattern:@"<[^>]*>|\n| "
options:0
error:nil];
string=[regularExpretion stringByReplacingMatchesInString:string options:NSMatchingReportProgress range:NSMakeRange(0, string.length) withTemplate:@""];
return string;
}
本文标题:IOS使用正则表达式去掉html中的标签元素,获得纯文本
本文链接:https://www.haomeiwen.com/subject/mlmnsttx.html
网友评论