pub enum Rule<'i> {
Show 17 variants
Literal(Literal<'i>),
CharClass(CharClass),
Group(Group<'i>),
Alternation(Alternation<'i>),
Repetition(Box<Repetition<'i>>),
Boundary(Boundary),
Lookaround(Box<Lookaround<'i>>),
Variable(Variable<'i>),
Reference(Reference<'i>),
Range(Range),
StmtExpr(Box<StmtExpr<'i>>),
Negation(Box<Negation<'i>>),
Regex(Regex<'i>),
Recursion(Recursion),
Grapheme,
Codepoint,
Dot,
}
Expand description
A parsed pomsky expression, which might contain more sub-expressions.
Variants§
Literal(Literal<'i>)
A string literal
CharClass(CharClass)
A character class
Group(Group<'i>)
A group, i.e. a sequence of rules, possibly wrapped in parentheses.
Alternation(Alternation<'i>)
An alternation, i.e. a list of alternatives; at least one of them has to match.
Repetition(Box<Repetition<'i>>)
A repetition, i.e. a expression that must be repeated. The number of required repetitions is constrained by a lower and possibly an upper bound.
Boundary(Boundary)
A boundary (start of string, end of string or word boundary).
Lookaround(Box<Lookaround<'i>>)
A (positive or negative) lookahead or lookbehind.
Variable(Variable<'i>)
An variable that has been declared before.
Reference(Reference<'i>)
A backreference or forward reference.
Range(Range)
A range of integers
StmtExpr(Box<StmtExpr<'i>>)
An expression preceded by a modifier such as enable lazy;
Negation(Box<Negation<'i>>)
Negated expression
Regex(Regex<'i>)
A regex string, which is not escaped
Recursion(Recursion)
A regex string, which is not escaped
Grapheme
A Unicode grapheme
Codepoint
A Unicode code point
Dot
The dot