首页 > 移动平台 > 详细

ios 正则表达式替换

时间:2014-09-29 10:20:38      阅读:315      评论: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://blog.csdn.net/majiakun1/article/details/39666163

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