regex_to_ebnf

Function regex_to_ebnf 

Source
pub fn regex_to_ebnf(
    regex: &str,
    with_rule_name: bool,
) -> Result<String, RegexError>
Expand description

Convert a regex string to an EBNF grammar string.

When with_rule_name is true the result is wrapped as root ::= <body>\n; otherwise just the rule body is returned. Faithful port of C++ RegexToEBNF.