Find code comments using regex in an IDE
So if you are a developer, you might need to clean up comments from a code that you might have copied from somewhere else and updating the documentation needs you to start from scracth, or you just want to get rid of comments. Afterall, it can’t be called code if can be understood. Just kidding!
/* Your comment goes here*/
/** * Your comments here * Your comments here again */
the search query would be like:
/\*(.|[\r\n])*?\*/ just make sure to select regex like I did in my case in the screenshot below, so search with the following and replace with
For HTML comments, you’d use something along these lines for the regex pattern for your search and replace query
\<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)\>