ios 正則表達式替换
2016-02-01 10:21
330 查看
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.length) withTemplate:@""];
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.length) withTemplate:@""];
相关文章推荐
- 对于iOS 7 隐藏特性和解决之道
- (NO.00005)iOS实现炸弹人游戏(八):游戏主角(一)
- (NO.00005)iOS实现炸弹人游戏(八):游戏主角(一)
- (NO.00005)iOS实现炸弹人游戏(八):游戏主角(一)
- iOS用三种途径实现一方法有多个返回值
- IOS使用Launch Screen.storyboard制作广告启动界面
- IOS开发之——蓝牙通信浅谈
- IOS-51-改变字符串中指定字符的颜色
- ios9 第三方SDK无法回调问题
- iOS开发学习之Quartz2D绘图
- iOS字体不清晰问题
- iOS数据类型转换。
- 调试kernel时对bios加电后过程的一些心得
- BIOS、MBR、PBR等基础知识
- 开源监控软件cacti+nagios+ntop整合
- iOS支付宝支付_第一节_签约与审核(签约到集成)
- iOS判断手机是否开启麦克风
- iOS中CoreData数据管理系列四——进行数据与页面的绑定
- 详细解析IOS中的CGContextAddArcToPoint方法的使用
- ios开发手势事件。