Welcome to CGrep Home-Page.
Cgrep is a grep tool suitable for searching in large code repositories. It supports 30 programming languages and searches that go beyond the simple pattern matching. It enables context-aware filtering and semantic searches through wildcard and combinators.
Features
Multi-threaded with configurable number of jobs.
Blazing fast: Running on a single core it is nearly as fast as GNU grep, up to 6x times faster than ack.
Multi-line pattern searches.
Colors highlight of tokens and strings matching.
Recursive searches: Support of language filters and pruning directories.
Standard searches: through Boyer–Moore and Posix Regex.
Code Tokenizer: Searches as prefix, infix, suffix and edit distance (Levenshtein distance).
Context-aware filters distinguish among code, comments and literals in different languages.
Languages support for Awk, C, Cpp, Chapel, Csharp, Css, CMake, D, Erlang, Fsharp, Go, Haskell, Html, Java, Javascript, Latex, Lua, Make, OCaml, ObjectiveC, Perl, PHP, Python, Ruby, Scala, Tcl, Text, Shell, Verilog, VHDL, Vim.
Semantic searches through wildcards and combinators. _, _1, _2..., $, $1, $2..., ANY, KEY, STR, CHR, NUM, HEX, OCT, OR. E.g. "_1(_1 && $)" search for move constructors, "struct OR class _ { OR : OR <" search for class declarations.
Customizable output with custom format string, XML and JSON back-ends.
Hackage
- Cgrep is available from Hackage and can be installed using the cabal utility.
Binary Releases
- The packages for AMD64 Debian Wheezy and Jessie are available at https://github.com/awgn/cgrep/releases
Authors
Nicola Bonelli nicola@pfq.io