I wanted to search my company's github source website using regular expressions. is that possible in anyway?
Asked
Active
Viewed 3.5k times
28

Salil Surendran
- 2,245
- 4
- 27
- 42
-
2Possible duplicate of [Github search using regex](https://stackoverflow.com/questions/17595962/github-search-using-regex) – Nathan Wailes Oct 12 '17 at 22:38
-
This is now possible with [GitHub Code Search](https://cs.github.com/). – davidmyersdev Jun 06 '22 at 13:35
-
[GitHub Code Search Regular Expressions](https://docs.github.com/en/search-github/github-code-search/understanding-github-code-search-syntax#using-regular-expressions) ... specific to _code_ searches. – marc-medley Jun 19 '23 at 23:56
2 Answers
8
AFAIK you would need to set that up yourself. Github has its own search syntax with qualifiers you can add, but not full regex. The api uses the same syntax as the in-browser search.

ldg
- 9,112
- 2
- 29
- 44
5
The problem is that a GitHub search is limited to the master
branch of your repos.
The easiest solution is to:
- clone your company's github source website
- do locally a
git grep
, which supports basic regexp or extended POSIX regexp (git grep -E
) - or a pickaxe search (
git log --all -S...
- or
git rev-list --all|grep xxx
which also allows for regexp