Reputation: 105
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
^@
Upvotes: 7
Views: 4065
Reputation: 116
Following @mahfuj-asif answer, you can update your regex like this \ \* @.*$|\/\*\*|\ \*\/
, to remove all generated annotations, by using the same principle.
For example if you have a code like this:
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
And want to remove this part:
/**
* @return int|null
*/
Upvotes: 0
Reputation: 1979
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
.
Upvotes: 8