Abuzar Amin
Abuzar Amin

Reputation: 1991

Regex to find the commented Code in XCode

I am trying to make a regex that will find all the commented code in Xcode project. Note that result of Regex must only contain commented code and must not contain the comments that we add to make the project more understandable.

Result of regex searching not contain the line like below

// this comment is added to make the function understandable

But contain the lines like

//  [super viewWillDisappear:animated];

Upvotes: 0

Views: 1169

Answers (2)

jayant rawat
jayant rawat

Reputation: 368

enter image description here

To anyone wondering how to use regular expression search "^./[/,*].;.*$" after selecting regular expression option from find menu after doing global search(command + shift + F)

Upvotes: 1

Abuzar Amin
Abuzar Amin

Reputation: 1991

I successfully make my required expression and it is

^.*/[/,\*].*;.*$

This will only find your single line or multiline commented code.

Upvotes: 7

Related Questions