Reputation: 3564
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>
Here using find/replace, I want to delete all lines starts with '<version>'
.
How to achieve this.
Upvotes: 14
Views: 10415
Reputation: 5143
Use the following regular expression to hide lines starting with 'public' -
Regex Line Replacement
public(.*)\R
Eclipse Config
Example
Upvotes: 5
Reputation: 15886
See the image:
^\s+<version>.*$
Upvotes: 9
Reputation: 69440
use this regexp: ^\s+<version>.*$
This will remove all lines starting with <version>
. Make sure you have checked the checkbox "Regular expression"
Upvotes: 15