Skip to main content

Crate smallgrep

Crate smallgrep 

Source
Expand description

§smallgrep

smallgrep is a lightweight, beginner-friendly implementation of grep written in Rust. It supports:

  • Case-sensitive and case-insensitive search
  • Exact (whole-word) matching
  • Optional colorized output

§Example

smallgrep cat file.txt
smallgrep cat file.txt --exact
smallgrep cat file.txt -i --colorize

This crate is primarily meant for learning.

Structs§

Config

Functions§

case_insensitive_search
Performs a case-insensitive substring search.
colorize_text
exact_search
Performs an exact (whole-word) search using a regex pattern.
run
search
Performs a case-sensitive substring search.