/RustVerbalExpressions

Verbal Expressions implementation for Rust

Primary LanguageRustMIT LicenseMIT

RustVerbalExpressions

Travis Crates.io

Verbal Expressions implementation for Rust. See Verbal Expressions for detail.

Install

Add the following to your Cargo.toml:

[dependencies]
verbal_expressions = "0.1.0"

Example

extern crate verbal_expressions;
use verbal_expressions::Verex;

fn main() {
  let v = Verex::new()
    .start_of_line()
    .then("http")
    .maybe("s")
    .then("://")
    .maybe("www.")
    .anything_but_not(" ")
    .end_of_line();

  let url = "https://www.google.com";

  assert!(v.is_match(url));
}

License

Copyright (c) 2014 woxtu

Licensed under the MIT license.