0

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];

2 Answers 2

7

I successfully make my required expression and it is

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

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

Sign up to request clarification or add additional context in comments.

1 Comment

How to use this regex ?
1

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)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.