如何替换/删除行以Eclipse中的特定单词开头? [英] How to replace/delete lines starts with particular word in Eclipse?
本文介绍了如何替换/删除行以Eclipse中的特定单词开头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在某些情况下,我必须替换/删除以 public, private Java类或XML文件的< version>
之类的特定单词开头的行。
Some cases, I have to replace/delete lines starts with particular word like 'public' 'private' Java classes or <version>
for XML file.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${version.bean.validation.hibernate}</version>
</dependency>
在这里使用查找/替换,我要删除所有以开头的行< version>'
。
如何实现。
Here using find/replace, I want to delete all lines starts with '<version>'
.
How to achieve this.
推荐答案
使用此正则表达式: ^ \s +< ; version>。* $
这将删除所有以< version>
开头的行。确保已选中正则表达式复选框
use this regexp: ^\s+<version>.*$
This will remove all lines starting with <version>
. Make sure you have checked the checkbox "Regular expression"
这篇关于如何替换/删除行以Eclipse中的特定单词开头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文