perg

A micro lightweight implementation of grep, written in Rust.

It's mainly for my journey to learn Rust programming language and its fascinated ecosystem, but feel free to use it if you like it. :smile:

```bash ❯ perg --help perg x.x.x Vinh Nguyen vinhnguyen2308@gmail.com perg is a small command-line tool to search for given string inside a file

USAGE: perg [FLAGS]

FLAGS: -h, --help Prints help information -i, --ignore-case Perform case insensitive matching. Default is case sensitive. -V, --version Prints version information

ARGS: pattern to search, can use regular expression path to file ```

Installation

Using Cargo via rustup:

bash ❯ curl https://sh.rustup.rs -sSf | sh

then install perg binary:

bash ❯ cargo install perg

Usage

a test.md is included in this repo, to try out perg: bash ❯ perg h test.md # hello world # hi world

perg also support regular expression search, like grep: ```bash ❯ perg "h[ei]" test.md # hello world # hi world

❯ perg "hello|bye" test.md # hello world # bye world

❯ perg "^(be)" test.md # bye world # end of file ```

case insensitive search: bash ❯ perg -i I test.md # hi world # end of file

Help, feedback or suggestions?

Feel free to contact me on Twitter for discussions, news & announcements & other projects. :rocket: