ios 正则表达式替换

时间:2014-09-29 10:20:38   收藏:0   阅读:317

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:@""];

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!