"Никакого кофе в мире не хватит, чтобы ускорить grep"
A fast grep alternative written in C, optimized for speed through algorithmic efficiency and SIMD vectorization.
This is alpha freaking ware and not ready for real usage.... yet
make# Basic literal string search
notagrep "hello" file.txt
# Fixed string search (no regex)
notagrep -F "hello world" file.txt
# Regex search (default)
notagrep "error|warning" file.txt
# Case insensitive search
notagrep -i "TODO" .
# Count matches
notagrep -c "function" src/
# List files with matches
notagrep -l "import" .- Alternation:
a|b|c - Character classes:
[a-z],[^0-9] - Quantifiers:
*,+,? - Anchors:
^(start of line),$(end of line) - Dot:
.(any character) - Grouping:
(...)
- Backreferences (
\1,\2, etc.) - Lookahead/lookbehind (
(?=...),(?<=...)) - Named groups (
(?P<name>...)) - Unicode character classes (
\p{...})
- SIMD vectorization (NEON on ARM64, AVX2 on x86-64)
- Aho-Corasick automaton for multi-pattern matching
- Boyer-Moore-Horspool with unrolled skip loop
- Inner literal extraction for regex prefiltering
- Rare byte frequency optimization
- Parallel file processing with thread pool
Clean-room implementations based on:
- Aho-Corasick: "Efficient String Matching: An Aid to Bibliographic Search" (1975) by Alfred Aho and Margaret Corasick
- Boyer-Moore: "A Fast String Searching Algorithm" (1977) by Robert Boyer and J Strother Moore
- Commentz-Walter hybrid: combines Aho-Corasick trie with Boyer-Moore skipping
See the source files for licensing information.
