[−][src]Crate libgrep_rs
grep-rs is a simple tool for searching through text
Currently Working Features
- Support for searching through files
- Support for searching through standard input
- Searching through text that includes specific patterns
- Searching through text that excludes specific patterns
- Printing all lines before the first instance of the pattern
- Printing all lines after the first instance of the pattern
- Case Insensitivity
Installation
Add this to your Cargo.toml
libgrep-rs = "0.1.1"
Example
use libgrep_rs::searcher::Searcher; use libgrep_rs::options::Options; fn main() { let options = Options::default(); let text = String::from("Hello World\n libgrep-rs test"); let pattern = String::from("World"); let searcher = Searcher::new(pattern, text, options); let output = searcher.search(); println!("{}", output); }
If it worked, the output will be
Hello World
Modules
options | Contains structs required for the configuration of the searcher module |
searcher | Contains structs used for searching through text |