Enum ReadableRe

Source
pub enum ReadableRe<'a> {
Show 63 variants Digit, Word, Whitespace, NonDigit, NonWord, NonWhitespace, Boundary, AsciiLetter, AsciiNonLetter, AsciiUppercase, AsciiNonUppercase, AsciiLowercase, AsciiNonLowercase, AsciiAlphanumeric, AsciiNonAlphanumeric, AsciiNumeric, AsciiNonNumeric, Hexadecimal, NonHexadecimal, Anything, Everything, SomethingGreedy, Something, AnyChar, Period, Caret, Dollar, Asterisk, PlusSign, MinusSign, QuestionMark, OpenBrace, CloseBrace, OpenBracket, CloseBracket, OpenParenthesis, CloseParenthesis, BackSlash, Pipe, Newline, Tab, Quote, DoubleQuote, Raw(&'a str), String(String), Concat(Concat<'a>), Escape(Escape<'a>), Group(Group<'a>), NamedGroup(NamedGroup<'a>), NonCaptureGroup(NonCaptureGroup<'a>), Optional(Optional<'a>), Either(Either<'a>), Exactly(Exactly<'a>), Ranged(Ranged<'a>), ZeroOrMore(ZeroOrMore<'a>), ZeroOrMoreLazy(ZeroOrMoreLazy<'a>), OneOrMore(OneOrMore<'a>), OneOrMoreLazy(OneOrMoreLazy<'a>), StartsWith(StartsWith<'a>), EndsWith(EndsWith<'a>), StartsAndEndsWith(StartsAndEndsWith<'a>), Chars(Chars), NotChars(NotChars),
}
Expand description

Enum wrapper around regex expressions, it is a recursive version of regexes

Variants§

§

Digit

digit match, "\d"

§

Word

word match, "\w"

§

Whitespace

whitespace match, "\s"

§

NonDigit

non digit match, "\D"

§

NonWord

non word match, "\W"

§

NonWhitespace

non whitespace match, "\S"

§

Boundary

boundary match, "\b"

§

AsciiLetter

ascii letters match, "[A-Za-z]"

§

AsciiNonLetter

ascii non letters match, "[^A-Za-z]"

§

AsciiUppercase

ascii uppercase letters match, "[A-Z]"

§

AsciiNonUppercase

ascii non uppercase letters match, "[^A-Z]"

§

AsciiLowercase

ascii lowercase letters match, "[a-z]"

§

AsciiNonLowercase

ascii non lowercase letters match, "[^a-z]"

§

AsciiAlphanumeric

ascii alphanumerics chars match, "[A-Za-z0-9]"

§

AsciiNonAlphanumeric

ascii non alphanumerics chars match, "[^A-Za-z0-9]"

§

AsciiNumeric

ascii numeric match, "[0-9]"

§

AsciiNonNumeric

ascii non numeric match, "[^0-9]"

§

Hexadecimal

hexadecimal match, "[0-9A-Fa-f]"

§

NonHexadecimal

non hexadecimal match, "[^0-9A-Fa-f]"

§

Anything

anything match, ".*?"

§

Everything

everything match, ".*"

§

SomethingGreedy

something match, greedy, ".+"

§

Something

something match, ".+?"

§

AnyChar

any char match, "."

§

Period

escaped period, "\."

§

Caret

escaped caret, "\^"

§

Dollar

escaped dollar, "\$"

§

Asterisk

escaped asterisk, "\*"

§

PlusSign

escaped plus sign, "\+"

§

MinusSign

escaped minus sign, "\-"

§

QuestionMark

escaped question mark, "\?"

§

OpenBrace

escaped open brace, "\{"

§

CloseBrace

escaped close brace, "\}"

§

OpenBracket

escaped open bracket, "\["

§

CloseBracket

escaped close bracket, "\]"

§

OpenParenthesis

escaped open parenthesis, "\("

§

CloseParenthesis

escaped close bracket, "\)"

§

BackSlash

escaped back slash, "\\"

§

Pipe

escaped pipe, "\|"

§

Newline

escaped new line, "\n"

§

Tab

escaped tab, "\t"

§

Quote

escaped quote, "\'"

§

DoubleQuote

escaped double quote, "\""

§

Raw(&'a str)

raw regex exp, "exp"

§

String(String)

raw regex exp (owned), "exp"

§

Concat(Concat<'a>)

concatenation of regex exp, "exp1exp2exp3", check solvers::Concat

§

Escape(Escape<'a>)

Special characters escape wrapper, check solvers::Escape

§

Group(Group<'a>)

Regex group, "(expr)", check solvers::Group

§

NamedGroup(NamedGroup<'a>)

named group match, "(?P<name>expr)", check solvers::NamedGroup

§

NonCaptureGroup(NonCaptureGroup<'a>)

non-capture group, "(?:expr)"

§

Optional(Optional<'a>)

optional match, "expr?", check solvers::Optional

§

Either(Either<'a>)

either match, "expr1|expr2|...", check solvers::Either

§

Exactly(Exactly<'a>)

exact number (n) of occurrences match, "expr{n}", check solvers::Exactly

§

Ranged(Ranged<'a>)

variance number (min, max) of occurrences match, "expr{min, max}", check solvers::Ranged

§

ZeroOrMore(ZeroOrMore<'a>)

zero or more occurrences match, "expr*", check solvers::ZeroOrMore

§

ZeroOrMoreLazy(ZeroOrMoreLazy<'a>)

zero or more occurrences, lazy match, "expr*?", , check solvers::ZeroOrMoreLazy

§

OneOrMore(OneOrMore<'a>)

one or more occurrences match, "expr+", check solvers::OneOrMore

§

OneOrMoreLazy(OneOrMoreLazy<'a>)

one or more occurrences, lazy match, "expr+?", , check solvers::OneOrMoreLazy

§

StartsWith(StartsWith<'a>)

match start, "^expr", check solvers::StartsWith

§

EndsWith(EndsWith<'a>)

match end, "expr$", check solvers::EndsWith

§

StartsAndEndsWith(StartsAndEndsWith<'a>)

match start and end, "^expr$", check solvers::StartsAndEndsWith

§

Chars(Chars)

match characters, "[chars]", check solvers::Chars

§

NotChars(NotChars)

exclude match characters, "[^chars]", check solvers::NotChars

Implementations§

Source§

impl<'a> ReadableRe<'a>

Source

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

Trait Implementations§

Source§

impl<'a> Add for ReadableRe<'a>

Source§

type Output = ReadableRe<'a>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a> Clone for ReadableRe<'a>

Source§

fn clone(&self) -> ReadableRe<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Display for ReadableRe<'_>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a> From<&'a str> for ReadableRe<'a>

Source§

fn from(s: &'a str) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<String> for ReadableRe<'a>

Source§

fn from(s: String) -> Self

Converts to this type from the input type.
Source§

impl<'a> FromIterator<ReadableRe<'a>> for Concat<'a>

Source§

fn from_iter<T: IntoIterator<Item = ReadableRe<'a>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<ReadableRe<'a>> for Either<'a>

Source§

fn from_iter<T: IntoIterator<Item = ReadableRe<'a>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<ReadableRe<'a>> for EndsWith<'a>

Source§

fn from_iter<T: IntoIterator<Item = ReadableRe<'a>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<ReadableRe<'a>> for Escape<'a>

Source§

fn from_iter<T: IntoIterator<Item = ReadableRe<'a>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<ReadableRe<'a>> for Group<'a>

Source§

fn from_iter<T: IntoIterator<Item = ReadableRe<'a>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<ReadableRe<'a>> for NonCaptureGroup<'a>

Source§

fn from_iter<T: IntoIterator<Item = ReadableRe<'a>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<ReadableRe<'a>> for OneOrMore<'a>

Source§

fn from_iter<T: IntoIterator<Item = ReadableRe<'a>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<ReadableRe<'a>> for OneOrMoreLazy<'a>

Source§

fn from_iter<T: IntoIterator<Item = ReadableRe<'a>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<ReadableRe<'a>> for Optional<'a>

Source§

fn from_iter<T: IntoIterator<Item = ReadableRe<'a>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<ReadableRe<'a>> for StartsAndEndsWith<'a>

Source§

fn from_iter<T: IntoIterator<Item = ReadableRe<'a>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<ReadableRe<'a>> for StartsWith<'a>

Source§

fn from_iter<T: IntoIterator<Item = ReadableRe<'a>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<ReadableRe<'a>> for ZeroOrMore<'a>

Source§

fn from_iter<T: IntoIterator<Item = ReadableRe<'a>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> FromIterator<ReadableRe<'a>> for ZeroOrMoreLazy<'a>

Source§

fn from_iter<T: IntoIterator<Item = ReadableRe<'a>>>(iter: T) -> Self

Creates a value from an iterator. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ReadableRe<'a>

§

impl<'a> RefUnwindSafe for ReadableRe<'a>

§

impl<'a> Send for ReadableRe<'a>

§

impl<'a> Sync for ReadableRe<'a>

§

impl<'a> Unpin for ReadableRe<'a>

§

impl<'a> UnwindSafe for ReadableRe<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.