Recap deserializes structures from regex named capture groups extracted from strings.
You may find this crate useful for cases where input is provided as a raw string in a loosely structured format. A common use case for this is when you're dealing with log file data that was not stored in a particular structed format like JSON but rather in a format that can be represented with a pattern.
Recap is provides what envy provides environment variables for named regex capture groups
Examples
Below is an example that derives a FromStr
for your type that will
parse into the struct using named capture groups
use Recap;
use Deserialize;
use Error;
You can also use recap by using the generic function from_captures
in which
case you'll be reponsible for bringing your only Regex reference.
💡 For convenience the regex crate's Regex
type is re-exported
use ;
use Deserialize;
use Error;