Expand description
String pattern matching.
§Overview
In the library, pattern matching is used to initialize delimiters for deserializers, like Delimited
and DelimitedEntries, and for validating string config params. Pattern matching
essentially generalizes the Pattern trait from the standard library.
Since the trait itself is unstable, we don’t use it directly; instead, we define the Split trait
and implement it for &str and [char; _] (via Pattern) and for Regexes from the eponymous crate
(via the LazyRegex wrapper; see its docs for why this wrapper is needed).
§Examples
- See
DelimitedandDelimitedEntriesfor the examples of usage of delimiters. - See the
validationmodule for the examples of string validation usingLazyRegex.
Macros§
- lazy_
regex - Creates a
LazyRegex.
Structs§
- Lazy
Regex - Transparent wrapper around a type dereferencing to a
Regex. Can be used as a separator, or in param validation. - Regex
- A compiled regular expression for searching Unicode haystacks.
Traits§
- Split
- Pattern usable for splitting strings. Used in
DelimitedandDelimitedEntriesdeserializers.