Enum redfa::regex::Regex [] [src]

pub enum Regex<T> {
    Null,
    Empty,
    Except(Vec<T>),
    Alt(Vec<T>, Vec<Regex<T>>),
    And(Vec<Regex<T>>),
    Not(Box<Regex<T>>),
    Cat(Vec<Regex<T>>),
    Kleene(Box<Regex<T>>),
}

A regular expression over the alphabet T.

Variants

Null

The null set. This never matches anything.

Empty

The empty string (matches exactly "").

Except(Vec<T>)

Matches any single character except the listed ones.

Alt(Vec<T>, Vec<Regex<T>>)

Alternation (also known as disjunction). Matches any of the contained characters, as well as any string matched by a contained regex.

And(Vec<Regex<T>>)

Conjunction. Matches iff all contained regexes match.

Not(Box<Regex<T>>)

Negation. Matches iff the contained regex does not match.

Cat(Vec<Regex<T>>)

Concatenation. Matches iff the contained regexes match in sequence.

Kleene(Box<Regex<T>>)

Kleene closure. Matches zero or more repetitions of the contained regex.

Methods

impl<T> Regex<T>
[src]

fn nullable(&self) -> bool

Tests whether a regular expression is nullable, i.e. whether it matches the empty string.

Trait Implementations

impl<T: Clone> Clone for Regex<T>
[src]

fn clone(&self) -> Regex<T>

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for Regex<T>
[src]

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

Formats the value using the given formatter.

impl<T: Eq> Eq for Regex<T>
[src]

impl<T: PartialEq> PartialEq for Regex<T>
[src]

fn eq(&self, __arg_0: &Regex<T>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Regex<T>) -> bool

This method tests for !=.

impl<T: Ord> Ord for Regex<T>
[src]

fn cmp(&self, __arg_0: &Regex<T>) -> Ordering

This method returns an Ordering between self and other. Read more

impl<T: PartialOrd> PartialOrd for Regex<T>
[src]

fn partial_cmp(&self, __arg_0: &Regex<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more

fn lt(&self, __arg_0: &Regex<T>) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more

fn le(&self, __arg_0: &Regex<T>) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

fn gt(&self, __arg_0: &Regex<T>) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more

fn ge(&self, __arg_0: &Regex<T>) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T: Ord> Normalize for Regex<T>
[src]

fn normalize(self) -> Self

impl FromStr for Regex<char>
[src]

type Err = ParseError

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Regex<char>, ParseError>

Parse a string as a regular expression.

impl<T: Ord + Clone> Differentiable<T> for Regex<T>
[src]

fn derivative(&self) -> Derivatives<T, Regex<T>>