For complex inputs, use actual peg parsers : https://docs.rs/peg/latest/peg/
For simplet inputs, express your intent with readable methods using a lib : https://github.com/sgreben/regex-builder/ & https://github.com/francisrstokes/super-expressive
For complex inputs, use actual peg parsers : https://docs.rs/peg/latest/peg/
For simplet inputs, express your intent with readable methods using a lib : https://github.com/sgreben/regex-builder/ & https://github.com/francisrstokes/super-expressive
There are certainly cases where different parsing methods/grammars are a better fit, but regex shines in many places.
I'd like to see some numbers on a tool like this. If a huge majority of people are seeing genuine improvements in their workflow with it, I won't be a luddite yelling at them. Rare, low-severity failures shouldn't hold us back.
But the potential cost of failure with (any) regex is very high, so I personally wouldn't want to trust any remotely mission-critical to a person who doesn't understand regex well enough to write it themself, and if they can write it on their own that's often faster than debugging AI-generated regex.
Would you feel better if it generated a regex-builder expression instead of a regex?
Even if regex-builder generates a regex under the hood?
In any case, the regex itself is only an implementation detail.