代码搜索工具-CGrep
Cgrep 是一个 grep 的工具,特别适合在大的代码库中进行搜索。支持 30 多种编程语言。通过通配符和组合符提供上下文感知的过滤和语义搜索,而不仅仅是简单的模式匹配。采用C语言开发并在GPLv2协议下授权。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, Coffee, 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.
最新版本:
项目主页:http://awgn.github.io/cgrep/