Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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.

like image 335
slugmandrew Avatar asked Mar 28 '14 13:03

slugmandrew


People also ask

How do I search with wildcard?

Wildcards take the place of one or more characters in a search term. A question mark (?) is used for single character searching. An asterisk (*) is used for multiple character searching.

Can you search in GitHub?

You can search globally across all of GitHub Enterprise Server, or scope your search to a particular repository or organization.


2 Answers

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".

like image 54
TimWolla Avatar answered Sep 22 '22 11:09

TimWolla


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

like image 21
mttdbrd Avatar answered Sep 20 '22 11:09

mttdbrd