Find & Replace with a wildcard in Xcode 4

自古美人都是妖i 提交于 2019-12-07 00:28:11

问题


I'm trying to find all instances of text inside "" marks with a semi-colon directly after them, and replace the text inside the "" marks. So, for example:

"FirstKey" = "First value";
"SecondKey" = "Second value";
"ThirdKey" = "Third value";

Would find only those values after the equals signs, and could replace them all (with a single string) at once, like so:

"FirstKey" = "BLAH";
"SecondKey" = "BLAH";
"ThirdKey" = "BLAH";

How can I do this? I found some stuff referring to regular expressions in Xcode 3, but such functionality seems either gone or hidden in Xcode 4.


回答1:


Regular expression replace is still available in Xcode 4. Use "Replace" and set style to "Regular Expression", use "([^"]*)"; as pattern and replace with "BLAH";.



来源:https://stackoverflow.com/questions/11471428/find-replace-with-a-wildcard-in-xcode-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!