pub enum PatternObject {
Any,
Start,
End,
String(String),
Quantifier(Quantifier, Box<PatternObject>),
Escaped(char),
Class(Class),
CaptureRef(u8),
Balanced(char, char),
Frontier(bool, Vec<SetPatternObject>),
Capture(u8, Pattern),
Set(bool, Vec<SetPatternObject>),
}
Expand description
A single object of a Lua pattern.
Variants§
Any
Match any character (.
).
Start
Match the start of the string (^
).
End
Match the end of the string ($
).
String(String)
A sequence of characters to match literally (eg. Hello, World!
).
Quantifier(Quantifier, Box<PatternObject>)
A PatternObject
followed by a Quantifier
(eg. a?
, .*
).
Escaped(char)
An escaped character to match literally (eg. %%
).
Class(Class)
A character class (eg. %w
, %L
).
CaptureRef(u8)
A reference to a previous capture group (eg. %1
).
Balanced(char, char)
A balanced pattern (eg. %bxy
). Matches all characters starting at x
until the
corresponding y
.
Frontier(bool, Vec<SetPatternObject>)
A frontier pattern (eg. %f[a-z]
). Matches if the following character matches the set and
the previous character does not match the set. The bool
indicated whether the set is
inverted.
Capture(u8, Pattern)
A capture group with a numeric ID and the contained Pattern
(eg. (a)
).
Set(bool, Vec<SetPatternObject>)
A set of SetPatternObject
s (eg. [a-z_%u]
, [^a-z_%u]
), the bool
specifies whether
the set is inverted. If the set is not inverted, it matches if any of the contained
entries matches. Otherwise, it matches if none of the contained entries match.
Trait Implementations§
Source§impl Clone for PatternObject
impl Clone for PatternObject
Source§fn clone(&self) -> PatternObject
fn clone(&self) -> PatternObject
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more