Xcode lazy regular expression
I'm trying to replace something like this:
NSSomeFunction(@"some var", @"another one")
With:
NSSomeOhterFunction(@"some var")
In Xcode. So these are source files... I bet the regular expression will look something like this:
NSSomeFunction\((.*), .+\)
But I need this to be lazy. Otherwise .+) will match the last parenthesis occurrence rather than the first (for example both parenthesis in the end would be replaced with a single one given this string: "NSLog(@"%@", NSSomeFunction(@"hey", @"lol"))" ).
How to do laz开发者_高级运维y search like this? I think you can do this in pearl using the modifier /U (ungreedy). Though Xcode does not seem to support that.
usually the ? will indicate non-greedy match, so for .+) you would use .+?)
精彩评论