首页 > 移动平台 > 详细

ios 正則表達式替换

时间:2016-02-01 13:53:49      阅读:101      评论:0      收藏:0      [点我收藏+]

1. 不可变字符串   (content 是不可变)

NSRegularExpression *regularExpression = [NSRegularExpression regularExpressionWithPattern:

                                      @"<(/{0,})div(.{0,})>" options:0 error:nil];

 content  = [regularExpression stringByReplacingMatchesInString:content options:0 range:NSMakeRange(0, content.length) withTemplate:@""];


1. 可变字符串   (content 是可变)

 [regularExpression replaceMatchesInString:content options:0 range:NSMakeRange(0, content.lengthwithTemplate:@""];

ios 正則表達式替换

原文:http://www.cnblogs.com/mengfanrong/p/5174642.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!