Trait safe_regex::IsMatch[][src]

pub trait IsMatch {
    fn is_match(&self, data: &[u8]) -> bool;
}

Provides an is_match function.

Required methods

fn is_match(&self, data: &[u8]) -> bool[src]

Returns true if data matches the regular expression, otherwise returns false.

This is a whole-string match. For sub-string search, put .* at the beginning and end of the regex.

Example

use safe_regex::{regex, IsMatch, Matcher0};
let matcher: Matcher0<_> = regex!(br"[abc][0-9]*");
assert!(matcher.is_match(b"a42"));
assert!(!matcher.is_match(b"X"));
Loading content...

Implementors

impl<F> IsMatch for Matcher0<F> where
    F: Fn(&[u8]) -> Option<()>, 
[src]

impl<F> IsMatch for Matcher1<F> where
    F: for<'d> Fn(&'d [u8]) -> Option<(Option<&'d [u8]>,)>, 
[src]

impl<F> IsMatch for Matcher2<F> where
    F: for<'d> Fn(&'d [u8]) -> Option<(Option<&'d [u8]>, Option<&'d [u8]>)>, 
[src]

impl<F> IsMatch for Matcher3<F> where
    F: for<'d> Fn(&'d [u8]) -> Option<(Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>)>, 
[src]

impl<F> IsMatch for Matcher4<F> where
    F: for<'d> Fn(&'d [u8]) -> Option<(Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>)>, 
[src]

impl<F> IsMatch for Matcher5<F> where
    F: for<'d> Fn(&'d [u8]) -> Option<(Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>)>, 
[src]

impl<F> IsMatch for Matcher6<F> where
    F: for<'d> Fn(&'d [u8]) -> Option<(Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>)>, 
[src]

impl<F> IsMatch for Matcher7<F> where
    F: for<'d> Fn(&'d [u8]) -> Option<(Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>)>, 
[src]

impl<F> IsMatch for Matcher8<F> where
    F: for<'d> Fn(&'d [u8]) -> Option<(Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>)>, 
[src]

impl<F> IsMatch for Matcher9<F> where
    F: for<'d> Fn(&'d [u8]) -> Option<(Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>)>, 
[src]

impl<F> IsMatch for Matcher10<F> where
    F: for<'d> Fn(&'d [u8]) -> Option<(Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>, Option<&'d [u8]>)>, 
[src]

Loading content...