How to search and replace 2 lines (together) in Eclipse?

后端 未结 5 1982
青春惊慌失措
青春惊慌失措 2020-12-07 22:19

I would like to search multiple files via eclipse for the following 2 lines:

@Length(max = L_255)
private String description;

and replace t

5条回答
  •  情歌与酒
    2020-12-07 22:51

    CTRL+H does take two lines if you use regexp (and you don't have to write the regexp by yourself, eclipse does that for you).

    1. Select your lines.
    2. Click CTRL+H. The search dialog opens up. If "Regular expression" is already checked, eclipse will have converted the two lines you search for into regexp for you, click Search. If "Regular expression" if not already checked", check it and click Cancel (eclipse remembers your choise).
    3. Select your lines again.
    4. Click CTRL+H. The search dialog opens up. This time "Regular expression" is already selected. eclipse will have converted the two lines you search for into regexp for you, click Search.

提交回复
热议问题