pub fn is_match<S>(pattern: S) -> Result<RegexPredicate, RegexError>where
    S: AsRef<str>,
Expand description

Creates a new Predicate that uses a regular expression to match the string.

Examples

use predicates::prelude::*;

let predicate_fn = predicate::str::is_match("^Hello.*$").unwrap();
assert_eq!(true, predicate_fn.eval("Hello World"));
assert_eq!(false, predicate_fn.eval("Food World"));