How to remove line contains starting with NSLog iOS? -


i have nslogs in code, many time. easy solution replace

nslog(@  //nslog(@ 

but, if want remove lines, starting nslog, can do?

thanks

in xcode search , replace project navigator. can select "starting with", "contains", "regular expression", etc.

using regular expression ^[\s\w]+nslog.*$ should work lines might have tab or space before nslog won't catch lines other text may in front of it. (notice in second screen shot nslog detected @ end of line, while first didn't).

another example might if want keep commented nslog lines , remove others:

^[^/*]*[\s\t]*nslog.*$  

would remove nslog on line 3 , nslog(@"%@",removed); on line 7.

// nslog /* nslog */ nslog  nsstring *nslog = @"not nslog"      nslog(@"%@",removed); 

additional examples:

enter image description here enter image description here enter image description here


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -