问题
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