码迷,mamicode.com
首页 > 移动开发 > 详细

ios 正则表达式替换

时间:2014-09-29 12:19:27      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:io   os   ar   sp   div   on   c   r   bs   

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 正则表达式替换

标签:io   os   ar   sp   div   on   c   r   bs   

原文地址:http://blog.csdn.net/majiakun1/article/details/39666163

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!