#line-search #file-search #case-insensitive #string-search #mini-grep #containing #txt

bin+lib minigrep-extremq

Example crate from the rustbook

1 unstable release

new 0.1.0 Sep 15, 2024

#2 in #mini-grep

Download history 111/week @ 2024-09-11

111 downloads per month

MIT/Apache

5KB
95 lines

minigrep

This is a very useful program that lets you search for lines that contain a specific string within a file.

Example usage

I do not know how to compile to an executable right now, so that's an issue.

Search for lines containing "frog":

cargo run -- frog poem.txt
# Outputs "How public, like a frog"

Search for lines containing "you know":

cargo run -- "you know" poem.txt
# Outputs "They'd banish us, you know."

Search for lines containing "to", but case insensitive:

IGNORE_CASE=1 cargo run -- "to" poem.txt
# Outputs 
Are you nobody, too?
How dreary to be somebody!
To tell your name the livelong day
To an admiring bog!

No runtime deps