Macro regex

Source
regex!() { /* proc-macro */ }
Expand description

Create a regex matcher

§Regex Syntax

  • .: matches any character
  • a: matches the character a
  • a*: matches zero or more a
  • a?: matches zero or one a
  • a+b: matches a or b
  • (a+b)*: matches zero or more a or b

§Example

use dfa_regex::regex;

regex!(Foo => "a*");
assert!(Foo::matches("aaaa"));
assert!(Foo::matches(""));
assert!(!Foo::matches("b"));