Struct rules::re::Regex [] [src]

pub struct Regex(_);

Methods

impl Regex
[src]

Returns true if and only if the regex matches the string given.

Example

let pineapple = Regex::new(r"pine
                             apple");
assert!(pineapple.is_match("I bought a pineapple."));

// Digit or `a`. `-` is set difference.
let char_class = Regex::new(r"<[ 0 .. 9 a .. z] - [ b .. z ]>");
assert!(char_class.is_match("3"));
assert!(char_class.is_match("a"));

assert!(!char_class.is_match("b"));
}

Trait Implementations

impl Debug for Regex
[src]

Formats the value using the given formatter.