Intellij idea 如何删除IntelliJ IDEA中的所有HTML注释?

Intellij idea 如何删除IntelliJ IDEA中的所有HTML注释?,intellij-idea,Intellij Idea,假设我有一个类似于: <html><!-- let's start the file --> <body><!-- I'm really chatty --> </body><!-- here's another useless comment --> </html><!-- ok, we ended the file --> 我想删除所有的评论,我试着从结构上查看编辑->查找->替换 我看

假设我有一个类似于:

<html><!-- let's start the file -->
  <body><!-- I'm really chatty -->
  </body><!-- here's another useless comment -->
</html><!-- ok, we ended the file -->
我想删除所有的评论,我试着从结构上查看编辑->查找->替换

我看不到此子菜单下存在删除HTML注释的模板。是否有办法将其创建为用户定义的模板或修改现有模板以实现此目的?

对此,您可以使用正则表达式搜索的正则替换或替换路径。使用以下正则表达式:

<!--.*?-->
并替换为空字符串。

您可以使用正则表达式搜索,在路径中使用正则替换或replace。使用以下正则表达式:

<!--.*?-->

并替换为空字符串。

您的项目堆栈是什么,您使用的构建工具是什么?不要紧,这是一个IDE问题。我不想在构建过程中删除注释。但这是Spring Boot。您的项目的堆栈是什么?您使用的构建工具是什么?应该没关系,这是一个IDE问题。我不想在构建过程中删除注释。但这是春靴。