Expand description
Abstractions for working with patterns.
Structs§
- AnyChar
- A pattern that matches anything.
- NotEnclosed
- Pattern that matches pattern
Innernot surrounded byEnclosure. - NotEscaped
- Pattern that matches pattern
Innernot escaped byPrefix. “escaped” here means that the patternInneris preceded by aPrefixthat’s not preceded by itself. - Ref
- Pattern that’s the reference to another pattern, used in generic code to reuse the pattern.
- Union
- A pattern that matches either of the 2 patterns in a short-circuiting manner,
with
selftried first. May be created byPattern::orfor convenience.
Traits§
- Pattern
- This trait represents an object that can be matched onto a string.
This includes functions, characters, [arrays of] characters, strings, but also custom patterns
like
NotEscaped
Functions§
- parse
- Parses 1 instance of pattern
pat. - parse_
group - Parse a balanced group of
open&closepatterns. - parse_
group_ ex - Parse a balanced group of
open&closepatterns. - parse_
until - Parses a span of the input until a match of pattern
patis met. - parse_
until_ ex - Like
parse_until, but also removes the match ofpatfrom the rest of the input. - parse_
while - Parses contiguous instances of pattern
pat.