whexy1999
VSCode Search: Exclude & Except

VSCode Search: Exclude & Except

Created
Dec 14, 2022 01:11 AM
Last edited time
Dec 14, 2022 01:30 AM
Tags
Here is the Linux kernel code base.
 
I want to find all code that includes start_kernel. In VSCode, I can do this.
 
notion image
notion image
I don’t want to see the code of architecture other than RISC-V, so I can exclude them.
This line means to exclude all files in the arch folder, except the one that starts with the letter ‘r’.
Notice that I still want to see all code including start_kernel out of the arch folder.
 
Or, I can use include to specify multiple architectures specifically.
./[^a]*/** includes all files except those in the folder starting with the letter ‘a’. The only folder that starts with ‘a’ is arch. So it means to include all files except those in the arch folder.
 
notion image