I\'d like to do the following in Xcode:
Find all NSLog commands without comments, and replace it with //NSLog...
In other words, I want to comment all NSLog
You can do this in a single find and replace operation. You can just do this simple Regular Expression replace. This handles both the commented(//) and non-commented lines. This also works even if the previous commented lines has more than two forward slashes(like ///)instead of rwo. You can refer this link. Do the following steps.
(/)*(NSLog.*) in Find field.//\2 in the Replace field.Enjoy the beauty of regular expressions ;-)