visual-studio-codetextselection

How to select every N line in vscode?


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


Solution

    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 grouped lines.
    5. Press to place the cursor at the beginning of every Nth line, or then to place the cursor at the end of every Nth line.

    enter image description here