> Wouldn't it be better to discriminate directories by adding a final slash/backslash?
> e.g. "debug/"
It would be more code. If someone wants to implement it, it can be included.
> Otherwise it would be impossible to avoid searching in files that have no extensions. E.g. how would one avoid searching inside a file simply named "makefile" or "README"?
Both files and directories that match the patterns are excluded. So if you are excluding the "release" directory you’ll also miss a file called "release".
> Moreover, how complex is the supported pattern syntax? Is it just a shell glob or does it support regular expressions (e.g. like the search/replace dialog)?
These are the extremely simple patterns with just "?" and "*" also allowed for the set of files to search. Its implemented by PatternMatch in FilePath.cxx.
There is another implementation of pattern matching in PathMatch.cxx that was done for EditorConfig support but it is more complex and would change the interpretation of patterns. It includes relative path matching, sets of characters, alternates, and numeric ranges.
Again, this would be more work so if someone wants to do it …