4 ms·
How about instead of an AI generating a regex we can't understand, we put energy using actually well developped method for parsing & validating text? Why put co
by florianfmmartin 4y ago
How about instead of an AI generating a regex we can't understand, we put energy using actually well developped method for parsing & validating text? Why put code you can't understand in your database?
For complex inputs, use actual peg parsers : https://docs.rs/peg/latest/peg/ 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/sgreben/regex-builder/ & https://github.com/francisrstokes/super-expressive https://github.com/francisrstokes/super-expressive
- column 4y agoReality check : there are people like my colleague who aren't software engineers and still have to occasionally maintain/create a regex in some corporate software config.
- soiler 4y agoThat's even worse. They might not have the knowledge to realize the regex an AI gives them is bunk, or to debug it when it fails. 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.
- thunky 4y ago> How about instead of an AI generating a regex we can't understand 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.
- b5n 4y agoOnce you know regex well enough to replace regex you realize that regex is pretty well developed. There are certainly cases where different parsing methods/grammars are a better fit, but regex shines in many places.