[−][src]Enum regex_syntax::Expr
A regular expression abstract syntax tree.
An Expr represents the abstract syntax of a regular expression.
Variants
EmptyAn empty regex (which never matches any text).
LiteralA sequence of one or more literal characters to be matched.
Fields of Literal
LiteralBytesA sequence of one or more literal bytes to be matched.
Fields of LiteralBytes
AnyCharMatch any character.
AnyCharNoNLMatch any character, excluding new line (0xA).
AnyByteMatch any byte.
AnyByteNoNLMatch any byte, excluding new line (0xA).
Class(CharClass)A character class.
ClassBytes(ByteClass)A character class with byte ranges only.
StartLineMatch the start of a line or beginning of input.
EndLineMatch the end of a line or end of input.
StartTextMatch the beginning of input.
EndTextMatch the end of input.
WordBoundaryMatch a word boundary (word character on one side and a non-word character on the other).
NotWordBoundaryMatch a position that is not a word boundary (word or non-word characters on both sides).
WordBoundaryAsciiMatch an ASCII word boundary.
NotWordBoundaryAsciiMatch a position that is not an ASCII word boundary.
GroupA group, possibly non-capturing.
Fields of Group
RepeatA repeat operator (?, *, + or {m,n}).
Fields of Repeat
Concat(Vec<Expr>)A concatenation of expressions. Must be matched one after the other.
N.B. A concat expression can only appear at the top-level or immediately inside a group expression.
Alternate(Vec<Expr>)An alternation of expressions. Only one must match.
N.B. An alternate expression can only appear at the top-level or immediately inside a group expression.
Methods
impl Expr[src]
pub fn parse(s: &str) -> Result<Expr>[src]
Parses a string in a regular expression syntax tree.
This is a convenience method for parsing an expression using the
default configuration. To tweak parsing options (such as which flags
are enabled by default), use the ExprBuilder type.
pub fn prefixes(&self) -> Literals[src]
Returns a set of literal prefixes extracted from this expression.
pub fn suffixes(&self) -> Literals[src]
Returns a set of literal suffixes extracted from this expression.
pub fn is_anchored_start(&self) -> bool[src]
Returns true if and only if the expression is required to match from the beginning of text.
pub fn has_anchored_start(&self) -> bool[src]
Returns true if and only if the expression has at least one matchable sub-expression that must match the beginning of text.
pub fn is_anchored_end(&self) -> bool[src]
Returns true if and only if the expression is required to match at the end of the text.
pub fn has_anchored_end(&self) -> bool[src]
Returns true if and only if the expression has at least one matchable sub-expression that must match the beginning of text.
pub fn has_bytes(&self) -> bool[src]
Returns true if and only if the expression contains sub-expressions that can match arbitrary bytes.
Trait Implementations
impl PartialEq<Expr> for Expr[src]
impl Clone for Expr[src]
fn clone(&self) -> Expr[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Eq for Expr[src]
impl Debug for Expr[src]
impl Display for Expr[src]
This implementation of Display will write a regular expression from the
syntax tree. It does not write the original string parsed.
Auto Trait Implementations
Blanket Implementations
impl<T> From for T[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,