How do I escape characters in GitHub code search?

前端 未结 3 1181
南方客
南方客 2021-02-04 23:12

I\'m trying to use GitHub\'s code search to search for some lines of code containing characters like =, +, etc.

I understand from https://help.

3条回答
  •  野性不改
    2021-02-04 23:33

    there is one more (some might say shameful) semi-solution/workaround: Using google...

    In the search field enter site:repo-url in addition to your keywords.

    I was searching for action$ in the redux-logic repo and was at least able to filter out all the other unwanted action (without the dollar-sign) results which were showing up in the github search. In Google i typed (pay attention to the quotes):

    site:https://github.com/jeffbski/redux-logic "action$"

    Unfortunately though, google won't list all results. That's why i wrote semi at the beginning. So you can try your luck quickly with google, if you don't find what you were looking for, fallback to checking out the git repo + search with offline-tools like vscode, intellij or cmd-line-tools as suggested by @Ran Ever-Hadani

    I hope github will soon come up with a brand-new search feature, which its users can love instead of hate.

提交回复
热议问题