0

I would like to strip HTML comments in Notepad++ and leave only code in an html file. How do I go about this? I can use regular expression search/replace.

2 Answers 2

11

I would use

<!--([^-]|-[^-])*-->

which is more robust (less permissive) than Oscar's solution.

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

Comments

2

After searching I couldn't find a simple solution , but then i created one that i would like to share.

in Select "Regular Expression" - Replace With field empty like this

Image

and that's it!. You need to carefully and inspect before and after so, not to loose actual code.I did not loose any code.

i hope it helps

1 Comment

+1 you know that you can embed screenshots in your answer right? ;)

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.