#Elegant way of writing regex in Rust

8 messages ยท Page 1 of 1 (latest)

tame dagger
stark cypress
#

I see you are constructing the regex string from the builder. May I introduce you to https://docs.rs/regex-syntax/0.7.4/regex_syntax/index.html. Unfortunately, regex doesn't expose a build_from_hir method, but regex::Regex is a light wrapper around regex_automata::meta::Regex which does have such a method: https://docs.rs/regex-automata/0.3.6/regex_automata/meta/struct.Builder.html#method.build_from_hir

#

This might make the code a lot simpler and less error prone. I believe you can also turn the Ast into a regex using the ast::Printer which might help with your original API

tame dagger
#

ok, thanks!

dusk quest
#

This looks like a pretty cool project

#

You might want to rename Standart to Standard though and make the logic module private