Skip to main content

Module pattern

Module pattern 

Source
Expand description

Abstractions for working with patterns.

Structs§

Any
A pattern that matches any 1 character.
Chain
A pattern that matches P1 immediately followed by P2.
Many
A pattern that matches any number of contiguous occurrences of the inner pattern T, including 0.
Maybe
A pattern that matches 0 or 1 occurrences of the inner pattern T, making it optional.
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.

Traits§

IntoPattern
A trait for converting values into patterns. It exists to bridge the gap between an easy to use library & a more performant, lean implementation.
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§

alphabetic
A copy of [char::alphabetic] with signature adjusted to be usable as a Pattern
alphanumeric
A copy of [char::alphanumeric] with signature adjusted to be usable as a Pattern
ascii
A copy of [char::ascii] with signature adjusted to be usable as a Pattern
ascii_alphabetic
A copy of [char::ascii_alphabetic] with signature adjusted to be usable as a Pattern
ascii_alphanumeric
A copy of [char::ascii_alphanumeric] with signature adjusted to be usable as a Pattern
ascii_control
A copy of [char::ascii_control] with signature adjusted to be usable as a Pattern
ascii_digit
A copy of [char::ascii_digit] with signature adjusted to be usable as a Pattern
ascii_graphic
A copy of [char::ascii_graphic] with signature adjusted to be usable as a Pattern
ascii_hexdigit
A copy of [char::ascii_hexdigit] with signature adjusted to be usable as a Pattern
ascii_lowercase
A copy of [char::ascii_lowercase] with signature adjusted to be usable as a Pattern
ascii_punctuation
A copy of [char::ascii_punctuation] with signature adjusted to be usable as a Pattern
ascii_uppercase
A copy of [char::ascii_uppercase] with signature adjusted to be usable as a Pattern
ascii_whitespace
A copy of [char::ascii_whitespace] with signature adjusted to be usable as a Pattern
control
A copy of [char::control] with signature adjusted to be usable as a Pattern
lowercase
A copy of [char::lowercase] with signature adjusted to be usable as a Pattern
numeric
A copy of [char::numeric] with signature adjusted to be usable as a Pattern
uppercase
A copy of [char::uppercase] with signature adjusted to be usable as a Pattern
whitespace
A copy of [char::whitespace] with signature adjusted to be usable as a Pattern