str-match
Match str with pattern like format!
.
Usage
use str_match;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
You can use "attribute"
features in nightly.
// with `str-match.features = ["attribute"]` in Cargo.toml
use str_match;
Limitations
This macro converts &str
to &[u8]
and use match slice pattern.
For example, "abc{x}ghi"
pattern is converted to [b'a', b'b', b'c', x @ .., b'g', b'h', b'i' ]
.
Because two or more variadic patterns are not allowed in slice pattern, only zero or one placeholder in str pattern is also allowed.
This macro can use single &str
matching, complex pattern (like (&str, &str)
) is not supported.