Module pattern

Source
Expand description

Abstractions for working with patterns.

Structs§

AnyChar
A pattern that matches anything.
NotEnclosed
Pattern that matches pattern Inner not surrounded by Enclosure.
NotEscaped
Pattern that matches pattern Inner not escaped by Prefix. “escaped” here means that the pattern Inner is preceded by a Prefix that’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 self tried first. May be created by Pattern::or for 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 & close patterns.
parse_group_ex
Parse a balanced group of open & close patterns.
parse_until
Parses a span of the input until a match of pattern pat is met.
parse_until_ex
Like parse_until, but also removes the match of pat from the rest of the input.
parse_while
Parses contiguous instances of pattern pat.