6

I have a large number of auto generated code files that are identifiable by the having _pb2 in the file name.

When I search using PyCharm CTRL+Shift+F I can use a file mask. I would like for instance to find all Python files *.py that do not have _pb2 in their name. Is there a way to achieve that?

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Epic
  • 572
  • 2
  • 18

1 Answers1

9

You can include and exclude files and directories by creating a Custom Scope that filters using a combination of filename wildcards.

  1. Ctrl+Shift+F to open "Find in Path".

  2. Create a new Custom Scope following steps 2-4 in the screenshot.

enter image description here

  1. Enter the pattern, for your specification it would be file[Project_Name]:*.py&&!file:*_pb2*

  2. Afterwards the search results are restricted to within the Custom Scope.

enter image description here

Source at JetBrains official site: "Scope configuration controls"

bad_coder
  • 11,289
  • 20
  • 44
  • 72