XCode 利用正则表达式查找替换字符

2018-05-07  本文已影响0人  mydisc1

参考如下链接:

我要替换的是

查找

[UIImage imageNamed:@"age_0_2_normal"]

替换为:

[UIImage imageNamed:@"age_0_2_normal" inBundle:YYGameResourceBundle compatibleWithTraitCollection:nil]

查找的正则表达式:

\[UIImage imageNamed:@\"(.*)\"\]

替换的正则表达式:

\[UIImage imageNamed:@\"$1\" inBundle:YYGameResourceBundle compatibleWithTraitCollection:nil\]

说明一下:.* 为查找的匹配

替换表达式中的 $1 代表 .*

https://www.jianshu.com/p/1e43741601ff

上一篇 下一篇

猜你喜欢

热点阅读