Intellij how to delete all line containing annotation?

Viewed 310

I want to delete all lines that contains annotation. I see there is a shortcut to delete line/selection. But how do i pass regex to the delete line shortcut so that all line that starts with @ gets deleted? I want to use like this ^@

1 Answers

You have to use replace option. Use Ctrl+R to open replace option, select regex(at the left side of search box there is a * sign). Enter @.*$ in replace box. Keep the replace with box empty.

The Regex means any line starting with @ followed by zero or more characters(digit/non digit/letter etc) and ended by end line.

enter image description here

Related