[][src]Enum ezregexp::Pattern

pub enum Pattern {
    Sequence(Vec<Pattern>),
    Text(String),
    Raw(String),
    Or(Vec<Pattern>),
    Many {
        exp: Box<Pattern>,
        low: u32,
        high: u32,
    },
    Digit,
    Letter,
    WordCharacter,
    InputStart,
    InputEnd,
    Not(Box<Pattern>),
    Any,
    Named {
        exp: Box<Pattern>,
        name: String,
    },
}

A Regular Expression Pattern

Variants

Sequence(Vec<Pattern>)

Sequence of patterns

Text(String)

Text

Raw(String)

Raw (unprocessed text), used internally

Alternative

Many

Repetition

Fields of Many

exp: Box<Pattern>low: u32high: u32
Digit

Digit

Letter

Letter,

WordCharacter

Word characters

InputStart

Start of line/input

InputEnd

End of line/input

Not(Box<Pattern>)

Negation

Any

Anything

Named

Named group

Fields of Named

exp: Box<Pattern>name: String

Implementations

impl Pattern[src]

pub fn and_either<PL: PatternList>(self, branches: PL) -> Self[src]

Chain an alternative

pub fn and_then<T: Into<Pattern>>(self, exp: T) -> Self[src]

Append a new pattern

pub fn and_maybe<T: Into<Pattern>>(self, exp: T) -> Self[src]

Append an optional pattern

pub fn and_maybe_many<T: Into<Pattern>>(self, exp: T) -> Self[src]

Append a pattern zero or more times

pub fn and_many<T: Into<Pattern>>(self, exp: T) -> Self[src]

Append a pattern one or more times

pub fn many(self, low: u32, high: u32) -> Self[src]

Repeat the previous pattern between low and high times

pub fn times(self, n: u32) -> Self[src]

Repeat the previous pattern n times

pub fn named<S: Into<String>>(self, name: S) -> Self[src]

name preceding pattern

pub fn must_end(self) -> Self[src]

Must reach end of input

Trait Implementations

impl Debug for Pattern[src]

impl Display for Pattern[src]

Generate regular expression from Pattern

impl<'_> From<&'_ str> for Pattern[src]

Convert a string into a text pattern

impl From<String> for Pattern[src]

Convert a string into a text pattern

impl ToCode for Pattern[src]

Convert Pattern to Rust code

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.