Struct predicates::str::RegexPredicate
[−]
[src]
pub struct RegexPredicate { /* fields omitted */ }
Predicate that uses regex matching
This is created by the predicate::str::is_match
.
Methods
impl RegexPredicate
[src]
pub fn count(self, count: usize) -> RegexMatchesPredicate
[src]
Require a specific count of matches.
Examples
use predicates::prelude::*; let predicate_fn = predicate::str::is_match("T[a-z]*").unwrap().count(3); assert_eq!(true, predicate_fn.eval("One Two Three Two One")); assert_eq!(false, predicate_fn.eval("One Two Three"));
Trait Implementations
impl Clone for RegexPredicate
[src]
fn clone(&self) -> RegexPredicate
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for RegexPredicate
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Predicate<str> for RegexPredicate
[src]
fn eval(&self, variable: &str) -> bool
[src]
Execute this Predicate
against variable
, returning the resulting boolean. Read more