SonOfLilit / kleenexp

modern regular expression syntax everywhere with a painless upgrade path
MIT License
73 stars 16 forks source link

Support `Rust` and `RustFancy` flavors #27

Open SonOfLilit opened 2 years ago

SonOfLilit commented 2 years ago

Teach the Rust compiler how to generate regular expressions that the regex crate knows how to read (mostly lots of errors for unsupported features), and how to generate regular expressions that the regex_fancy crate knows how to parse (there might be a few small syntactic differences vs. Python that need to be special cased).

Every to_regex() call includes a Flavor parameter that can be used to change the output when outputting regex for different engines. That's a good place to start, that and the Python and Rust regex implementations.