问题
I want to search a repository for any files that end in *Test.java*
but if I search for *Test.java*
I just get files that contain that exact string.
I can't find any information anywhere that suggests this is possible. Is this just due to limitations of indexing such an enormous amount of data?
I'd like to find a way to search a repo for all classes ending in Test
.
回答1:
The easiest way to find a file in a repository is to use the file finder. You can activate it at any time when you are in repository view by pressing t. See this screenshot from the official annoucement:

The file finder will perform some fuzzy matching using the characters you input into the "search box".
回答2:
Check out the search syntax page:
https://help.github.com/articles/search-syntax
And searching in repositories:
https://help.github.com/articles/searching-repositories
For this particular one:
Test.java in:name extension:java language:java
Edit 1:
Here's a picture to explain how to view code matches instead of repository matches:

Edit 2:
Turns out the comment above was right. This is what the GitHub people say:
Hi,
The easiest method for finding files within a repository is to use the file finder:
https://github.com/blog/793-introducing-the-file-finder
You can also use the "in:" search qualifier which allows you to tell search to match filenames as well:
https://help.github.com/articles/searching-code#search-in
Hope that helps!
Edit 3:
Although it doesn't use wildcards as we're used to, it uses regular expressions to find substrings of the strings you type. See below, I typed "SandTest.java" and it produced wild-card like results.

来源:https://stackoverflow.com/questions/22714654/can-i-do-a-wildcard-search-on-github-com