regex!() { /* proc-macro */ }
Expand description
Create a regex matcher
§Regex Syntax
.
: matches any charactera
: matches the charactera
a*
: matches zero or morea
a?
: matches zero or onea
a+b
: matchesa
orb
(a+b)*
: matches zero or morea
orb
§Example
use dfa_regex::regex;
regex!(Foo => "a*");
assert!(Foo::matches("aaaa"));
assert!(Foo::matches(""));
assert!(!Foo::matches("b"));