less than 1 minute read

Let’s search for files that contain two words at once using Visual Studio Code.

  1. Open the search box (Ctrl + + F)
  2. Check “Use Regular Expression” (Alt + R)
  3. Search with a regular expression like the one below

(word1[\s\S\n]*word2)|(word2[\s\S\n]*word1)

References

  • https://code.visualstudio.com/updates/v1_29#_multiline-search
  • https://stackoverflow.com/questions/49944569/search-in-vs-code-for-multiple-terms

Tags:

Categories:

Updated:

Leave a comment