Remove source file comments using IntelliJ?
来源:互联网 发布:itv198高清网络电视 编辑:程序博客网 时间:2024/06/16 05:06
You can use the "Replace" (or "Replace in Path" if you want to remove comments in multiple files) in the regular expression mode and then use this regular expression in the "Text to find" field:
(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/|[ \t]*//.*)
and replace it with an empty string. Then press "All" to apply this replacement to the entire file or all the selected files. This will remove all block comments and line comments from your file. If you want only block comments to be removed, use this regex instead:
(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/)
And if you want to just remove line comments, you can use this regex:
([ \t]*//.*)
However, I should warn that this works only %99.99 of times. You might have a string variable defined in your file like:
String myStr = "/** I am not a comment */";
This regex will turn this to:
String myStr = "";
:D
Hope this helps.
- Remove source file comments using IntelliJ?
- gcc remove comments
- Remove Nested Comments.
- 722. Remove Comments
- 722. Remove Comments
- Funny Source Code Comments
- IntelliJ IDEA :decompiled.class file bytecode version:52.0(java 8) ,open source file.
- comments on open source groupware projects
- comments on several open source groupware
- Android: How to download the latest zip Android Source Code easily and using it in Intellij
- Comments
- Comments
- Linux - How to remove the new line at the end of file when using vim
- p3:An open source pcap packet and NetFlow file analysis tool using Hadoop MapReduce and Hive.
- EXT2 file system file.c with my comments
- How to remove the //TODO comments from auto-generated code
- Resource file and Source file
- Remove SVN From Intellij IDEA
- Lua中的元方法总结
- JAVA 上转型对象
- linux下查询文件的创建时间和访问时间
- html5标签语义化
- redis 用setbit(bitmap)统计活跃用户
- Remove source file comments using IntelliJ?
- About悬浮窗
- 推荐微信排版工具
- 直播项目,在线聊天功能--socket实现客户端和服务器端通讯的简单案例
- Spark独立应用程序编程
- eclipse 安装MyBatis Generator 插件
- 基于netty实现的socks5代理协议
- DefaultListableBeanFactory 类继承分析二
- linux下显示所有符号的命令