Module demo

Module demo 

Source
Available on crate feature demo only.
Expand description

A demonstration of the types produced by the regex! macro.

The Email and EmailCapture types have both been implemented by the following code:

regex! {
    pub Email = r"(\w+)@(?<domain>(\w+)(\.\w+)?)"
}

Notable features include:

  • A fully expanded ‘matcher’ type expression under Email::Pattern, used to call a set of associated methods and perform the compile time matching.
  • Numbered and named captures generated specfic to the regular expression.
    • Optional and essential captures use Option as required.
  • Lazily sliced capture groups.

Structs§

Email
A macro-generated regular expression matching the pattern: (\w+)@(?<domain>(\w+)(\.\w+)?) with flags: []. See the Regex trait for associated matching and capturing functions.
EmailCapture
A macro-generated type that holds 5 captures for the associated regex, Email. If present, named groups can be retrieved through their associated method.