[][src]Struct grep_regex::RegexMatcher

pub struct RegexMatcher { /* fields omitted */ }

An implementation of the Matcher trait using Rust's standard regex library.

Methods

impl RegexMatcher[src]

pub fn new(pattern: &str) -> Result<RegexMatcher, Error>[src]

Create a new matcher from the given pattern using the default configuration.

pub fn new_line_matcher(pattern: &str) -> Result<RegexMatcher, Error>[src]

Create a new matcher from the given pattern using the default configuration, but matches lines terminated by \n.

This is meant to be a convenience constructor for using a RegexMatcherBuilder and setting its line_terminator to \n. The purpose of using this constructor is to permit special optimizations that help speed up line oriented search. These types of optimizations are only appropriate when matches span no more than one line. For this reason, this constructor will return an error if the given pattern contains a literal \n. Other uses of \n (such as in \s) are removed transparently.

Trait Implementations

impl Clone for RegexMatcher[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for RegexMatcher[src]

impl Matcher for RegexMatcher[src]

type Captures = RegexCaptures

The concrete type of capturing groups used for this matcher. Read more

type Error = NoError

The error type used by this matcher. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]