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.
Use the following regular expression to hide lines starting with 'public' -
Regex Line Replacement
public(.*)\R
Eclipse Config
Example
use this regexp: ^\s+<version>.*$
This will remove all lines starting with <version>
. Make sure you have checked the checkbox "Regular expression"
See the image:
^\s+<version>.*$
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With