不使用正则,直接替换就可以NSString *str=@"hello “world“";
str=[[str stringByReplacingOccurrencesOfString:@" " withString:@" "] stringByReplacingOccurrencesOfString:@"“" withString:@"\""];
NSLog(@"str:%@",str);
str=[[str stringByReplacingOccurrencesOfString:@" " withString:@" "] stringByReplacingOccurrencesOfString:@"“" withString:@"\""];
NSLog(@"str:%@",str);
解决方案 »
- iPhone向服务器端传文件
- 请教,如何让传统asp.net web程序在Ipad上能运行
- SpeakHere的问题
- 最近在学ios,感觉还是英文版的书更新些,分享一些吧
- view controllers is discouraged
- c字符转OC字符串问题
- iPhone培训应用游戏开发班(全天班)
- 大神的进
- ffmpeg Pcm 转AAC Specified sample format s16 is invalid or not supported
- 高手看过来!求解,坐等回复啊!看了好几天,没有头绪。
- 【如何修改变量只读属性】NSURLConnection中的NSURLProtectionSpace如何设置ServerTrust?
- ad hoc 上架也要通过 https://itunesconnect.apple.com填写一大堆app的信息?
http://www.cnblogs.com/web-d/archive/2010/04/16/1713298.html
<.*?>|&.{1,9};
您可以使用正则来匹配得到所有匹配 &\w+;的数组集合,再遍历进行替换,你可以维护一个你给的地址
http://www.cnblogs.com/web-d/archive/2010/04/16/1713298.html
中所有出现过的字符匹配,使用KV的形式来存储如 @{@" ":@" ", @"“":@"\"", .........}
在使用正则匹配得到的集合遍历中,根据key来得到value 然后再进行替换