3 ms·
Details about the query syntax you can play with at https://codestat.dev/explorer https://codestat.dev/explorer Basic format is: content:output((REGEXP) -
by slimsag 5y ago
Details about the query syntax you can play with at https://codestat.dev/explorer https://codestat.dev/explorer
Basic format is:
content:output((REGEXP) -> $1)
For example, this query will find all `License: <word>` instances in code/text files across all 2 million repos. It selects (`-> $1`) the first regexp capture group `(\w+)`:
content:output(License: (\w+)\n -> $1) count:all
There are some options you can add, like `count:all` (get all results it can find, will timeout after 60s), `repo:github\.com/myorg/` (regexp filter to just your repos)
Can use this for code mining, too: to find out what the most common delimiter passed to `strings.Split` in Go is, for example:
lang:go content:output(strings\.Split\(.*, (.*)\) -> $1) count:all