slugmandrew
slugmandrew

Reputation: 1836

Can I do a wildcard (*) search on github.com?

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.

Upvotes: 34

Views: 40075

Answers (2)

mttdbrd
mttdbrd

Reputation: 1831

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:

enter image description here

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.

enter image description here

Upvotes: 6

TimWolla
TimWolla

Reputation: 32701

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:

enter image description here

The file finder will perform some fuzzy matching using the characters you input into the "search box".

Upvotes: 13

Related Questions