How to select every N line in vscode?

Viewed 19990

How can I select every N lines in visual studio code. I can't find a proper regualr expression can let me do this.

3 Answers
  1. Press Ctrl+F or command+F.
  2. If not already enabled, press Alt+R or option+command+R to toggle RegEx searching (or press the .* button).
  3. Enter (.*\n){N} into the search field, replacing N with the number of lines to select (such as (.*\n){2} for every second line).
  4. Press Alt+Enter or option+return or Select All Occurrences of find Match from the command palette to select every Nth line.

enter image description here

Related