Struct grep::GrepBuilder
[−]
[src]
pub struct GrepBuilder { // some fields omitted }
A builder for a grep searcher.
Methods
impl GrepBuilder
[src]
fn new(pattern: &str) -> GrepBuilder
Create a new builder for line searching.
The pattern given should be a regular expression. The precise syntax supported is documented on the regex crate.
fn line_terminator(self, ascii_byte: u8) -> GrepBuilder
Set the line terminator.
The line terminator can be any ASCII character and serves to delineate the match boundaries in the text searched.
This panics if ascii_byte
is greater than 0x7F
(i.e., not ASCII).
fn case_insensitive(self, yes: bool) -> GrepBuilder
Set the case sensitive flag (i
) on the regex.
fn size_limit(self, limit: usize) -> GrepBuilder
Set the approximate size limit of the compiled regular expression.
This roughly corresponds to the number of bytes occupied by a single compiled program. If the program exceeds this number, then a compilation error is returned.
fn dfa_size_limit(self, limit: usize) -> GrepBuilder
Set the approximate size of the cache used by the DFA.
This roughly corresponds to the number of bytes that the DFA will use while searching.
Note that this is a per thread limit. There is no way to set a global limit. In particular, if a regex is used from multiple threads simulanteously, then each thread may use up to the number of bytes specified here.
fn build(self) -> Result<Grep>
Create a line searcher.
If there was a problem parsing or compiling the regex with the given options, then an error is returned.
Trait Implementations
impl Clone for GrepBuilder
[src]
fn clone(&self) -> GrepBuilder
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more