How do you delete lines with certain keywords in VScode

前端 未结 1 1108
心在旅途
心在旅途 2020-12-30 06:27

I have this regular expression to find certain keywords on a line:

.*(word1|word2|word3).*

In the find and replace feature of the latest VS

相关标签:
1条回答
  • 2020-12-30 06:44

    If you want to delete the entire line make your regex find the entire line and include the linefeed as well. Something like:

    ^.*(word1|word2|word3).*\n
    

    Then ALT-Enter will select all lines that match and Delete will eliminate them including the lines they occupied.

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