Struct verex::Verex [] [src]

pub struct Verex {
    // some fields omitted
}

The struct used for building verbal expression objects

Methods

impl Verex

fn new() -> Verex

Standard Constructor

fn from_string(string: String) -> Verex

Create a Verex object from a String

fn from_str(string: &str) -> Verex

Create a Verex object from a &str

fn compile(&self) -> Result<Regex, Error>

Compile the Verex to a Regex and return the result

fn raw(&self) -> &str

Return the raw regex string contained in the Verex

fn regex(&self) -> Result<Regex, Error>

Compile the Verex to a Regex and return the result

fn source(&self) -> &str

Return the raw regex string contained in the Verex

fn value(&self) -> &str

Return the raw regex string contained in the Verex

fn any(&mut self, chars: &str) -> &mut Verex

Any of the given characters

fn any_of(&mut self, chars: &str) -> &mut Verex

See any()

fn anything(&mut self) -> &mut Verex

Any character zero or more times

fn anything_but(&mut self, chars: &str) -> &mut Verex

Any character zero or more times except the provided characters

fn br(&mut self) -> &mut Verex

A line break!

fn capture(&mut self, value: &str) -> &mut Verex

Find a specific string and capture it (will be escaped)

fn capture_expr(&mut self, expr: Expression) -> &mut Verex

Find a sub-expression and capture it (won't be escaped)

fn digit(&mut self) -> &mut Verex

Add the token for matching digits

fn end_of_line(&mut self) -> &mut Verex

Add a token for matching the end of a line

fn find(&mut self, value: &str) -> &mut Verex

Find a specific string that will be escaped

fn find_expr(&mut self, expr: Expression) -> &mut Verex

Find an expression (does not get escaped)

fn line_break(&mut self) -> &mut Verex

A line break!

fn maybe(&mut self, value: &str) -> &mut Verex

Any string either one or zero times

fn maybe_expr(&mut self, expr: Expression) -> &mut Verex

Any string either one or zero times

fn or(&mut self) -> &mut Verex

Either match the sub-expression before or after this

fn or_find(&mut self, value: &str) -> &mut Verex

Either match the sub-expression before or the provided value

fn or_find_expr(&mut self, expr: Expression) -> &mut Verex

Either match the sub-expression before or the provided sub-expression

fn range(&mut self, range: Vec<(char, char)>) -> &mut Verex

A range of characters e.g. [A-Z] Usage example: verex.range(vec![('a', 'z'),('A', 'Z')])

fn repeat_n(&mut self, n: u32) -> &mut Verex

Repeat the previous item n times

fn repeat_n_to_m(&mut self, n: u32, m: u32) -> &mut Verex

Repeat the previous item n to m times

fn repeat_once_or_more(&mut self) -> &mut Verex

Repeat the previous item once or more times

fn repeat_previous(&mut self, n: u32) -> &mut Verex

Repeat the previous item n times

fn repeat_zero_or_more(&mut self) -> &mut Verex

Repeat the previous item zero or more times

fn replace(&self, text: &str, replacement: &str) -> Result<String, Error>

Replace a substring

fn search_one_line(&mut self, enable: bool) -> &mut Verex

Toggle whether ^ and $ match line start and end or string start and end

fn something(&mut self) -> &mut Verex

Any character at least one time

fn something_but(&mut self, chars: &str) -> &mut Verex

Any character at least one time except for these characters

fn start_of_line(&mut self) -> &mut Verex

Add a token for the start of a line

fn tab(&mut self) -> &mut Verex

Add a token for a tab

fn then(&mut self, value: &str) -> &mut Verex

To use find "in the sentence" and make the chaining flow better

fn with_any_case(&mut self, enable: bool) -> &mut Verex

Toggle whether to match case-sensitively or not

fn word(&mut self) -> &mut Verex

Any alphanumeric characters

Trait Implementations

impl Display for Verex

fn fmt(&self, f: &mut Formatter) -> Result

impl Eq for Verex

impl FromStr for Verex

type Err = Void

fn from_str(s: &str) -> Result<Verex, Void>

impl PartialEq for Verex

Equality comparison is based on the original string. It is possible that different verbal expressions have the same matching behavior, but are still compared unequal.

fn eq(&self, other: &Verex) -> bool

fn ne(&self, other: &Rhs) -> bool

Derived Implementations

impl Clone for Verex

fn clone(&self) -> Verex

fn clone_from(&mut self, source: &Self)

impl Debug for Verex

fn fmt(&self, __arg_0: &mut Formatter) -> Result