drgrep ✨
drgrep
is a simple, fast command-line tool written in Rust for searching patterns in text, with minimal external dependencies (beyond Rust itself). It's inspired by grep
but uses a simplified and custom regular expression (regex) engine, designed to be lightweight and easy to integrate.
🚀 Features
- Simple Text Searching: Find lines matching a given pattern in files or from standard input.
- Custom Regex Engine: Uses an internal implementation for a limited but useful subset of regex features (see Supported Regex Syntax).
- Fast and Lightweight: Written in Rust for performance and memory safety.
- Cross-Platform: Pre-compiled binaries are available for Linux, macOS, and Windows via GitHub Releases.
- Minimal External Dependencies: Designed to minimize dependencies (check your final
Cargo.toml
).
⚙️ Installation
You can install drgrep
in several ways:
1. Pre-compiled Binaries (Recommended)
Download the binary corresponding to your operating system from the GitHub Releases page.
- Go to the releases page.
- Find the latest release.
- Download the archive for your OS (
drgrep-linux
,drgrep-macos
,drgrep-windows.exe
). - (Optional) Rename the file to
drgrep
(ordrgrep.exe
) and place it in a directory included in your system'sPATH
.
2. From Source (with Cargo)
If you have Rust and Cargo installed (rustup
), you can compile from source:
# Clone the repository
# Compile in release mode
# The binary will be located at target/release/drgrep
# You can copy it to your PATH:
# sudo cp target/release/drgrep /usr/local/bin/ # Example for Linux/macOS
3. From Crates.io
You can install it directly with Cargo:
📚 Usage
The basic syntax is:
Examples:
Basic Regex searching in the .github/
Output:
Find "error" in the application.log file
Find 5-letter words in a file (requires supported syntax)
Using pipe
|
And other advanced regex features...
🌱 Contributing
Contributions are welcome! Feel free to open an Issue to report a bug or suggest an improvement, or a Pull Request with your changes. Please follow standard open-source contribution practices.
📜 License
This project is distributed under the MIT
License. See the LICENSE file for more details.