How to replace/delete lines starts with particular word in Eclipse?

后端 未结 3 2245
轮回少年
轮回少年 2021-02-19 23:55

Some cases, I have to replace/delete lines starts with particular word like \'public\' \'private\' Java classes or for XML file.

           


        
相关标签:
3条回答
  • 2021-02-20 00:02

    See the image:

    1. add regular expression as Jens correctly mentioned ^\s+<version>.*$
    2. put nothing in here.
    3. Check on regular expression option.
    4. Click Replace All.

    enter image description here

    0 讨论(0)
  • 2021-02-20 00:08

    use this regexp: ^\s+<version>.*$ This will remove all lines starting with <version>. Make sure you have checked the checkbox "Regular expression"

    0 讨论(0)
  • 2021-02-20 00:26

    Use the following regular expression to hide lines starting with 'public' -

    Regex Line Replacement

    • public(.*)\R

    Eclipse Config

    Example

    0 讨论(0)
提交回复
热议问题