A minimalist command-line search tool written in Rust. It mimics basic grep functionality while supporting regex matching, case-insensitive search, and colorized output of matched text.
This project was originally based on the Rust Book's "minigrep" tutorial project. I extended it by:
- Replacing basic string matching with full regex support
- Adding ANSI-colored highlighting for matched text
- Improving error handling and robustness
- Writing and expanding unit tests
- Packaging it as a portfolio-ready CLI tool
The goal was to take a guided learning exercise and evolve it into a standalone, functional tool that reflects real-world Rust development practices.
- Regex-based line search (powered by the
regexcrate) - Case-insensitive mode via the IGNORE_CASE environment variable
- Highlighted matches using the
coloredcrate - Graceful error handling (invalid regex, missing file, etc.)
- Unit tests included
-
Build the project: cargo build --release
-
Run the tool: cargo run -- <file_path>
Example: cargo run -- "Rust.*productive" ./sample.txt
-
Case-insensitive search: IGNORE_CASE=1 cargo run -- "rust" ./sample.txt
To run all included unit tests:
cargo test
- regex
- colored
- Support for CLI flags like --ignore-case
- Optional literal match mode
- Multiple match highlights per line
MIT License
(c) 2025 TMottur