I have this regular expression to find certain keywords on a line:
.*(word1|word2|word3).*
In the find and replace feature of the latest VSCode it works ok and finds the words but it just blanks the lines leaving big gaps in-between.
I would like to delete the entire line including linefeed.
The find and replace feature doesnt seem to support reg exp in the replace field.
Ctrl + Shift + L will delete the line and not copy to the clipboard.
The code formatting is available in Visual Studio Code through the following shortcuts: On Windows Shift + Alt + F. On Mac Shift + Option + F. On Linux Ctrl + Shift + I.
Alt-Enter to select all of the instances of the string on the page. Cmd-L to broaden the selection to the entire line of each instance on the page. Delete/Backspace to remove those lines. Show activity on this post.
1. Select the text to check. 2. Ctrl/Cmd-Shift-L selects all occurrences. 3. Ctrl/Cmd-I will select the entire line. 4. Delete or whichever other action you want to do with selected lines
VSCode/Sublime how to select and remove all lines containing an occurrence 1. Select the text to check.. 2. Ctrl/Cmd-Shift-L selects all occurrences.. 3. Ctrl/Cmd-I will select the entire line.. 4. Delete or whichever other action you want to do with selected lines. I hope this helped and I have ...
Given that we have a big file which includes a quite large number of duplicated lines, follow the following steps can easily remove the duplicates. 2. Press F1 or Ctrl + H to open the Replace mode 3. Toggle the “Use Regular Expression” icon 4. In the search field, type ^ (.*) ( \1)+$ 5. In the replace field, type $1 6.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With