A fork of Google Code Search — fast regular expression search over large codebases using a trigram index. Extended with match limits, symlink control, file exclusion, brute-force mode, context lines, a web UI, and a 64-bit index format.
# Install (Go 1.16+)
go install github.com/junkblocker/codesearch/cmd/...@latest
# Index your code
cindex $HOME/src /usr/include
# Search
csearch 'func.*Open'make all # lint, vet, test, build, install
make test # tests with race detection
make release # cross-compile for all platforms| Command | Purpose |
|---|---|
cindex |
Build/update the trigram index |
csearch |
Search indexed files by regexp |
cgrep |
Direct regexp grep (no index) |
csweb |
Web search UI (localhost:2473) |
Full structured documentation is in the sibling codesearch-docs repository.
github.com/junkblocker/codesearch/releases
BSD-style. See LICENSE.
Regular Expression Matching with a Trigram Index by Russ Cox.