Honestly, writing a regex is way easier than reading a regex, no? So it feels like now I have the harder task of proving that the generated regex is correct.
Or you can use "verbose regex" which some languages implement like in Python (https://docs.python.org/3/library/re.html#re.X). The spaces are ignored and you can add comments on each line. I used this in the past and my coworkers were happy about it because they could understand the regex and even modify it.
I consider myself a product designer so this is absolutely not true for me. Every time I try to write a Regex I have no idea how to even start. Copilot has been really good at starting me off and then I’ll take it to a regex site and understand it
That's why LLMs aren't much help to me -- they just increase my workload by giving me more code to read and review. If I write it myself, I already know what it means, so that saves time and effort.
I find this mostly pays off in debugging: Having written code usually means I know it better than code I've reviewed, which I know better than code I've never seen. Finding a weird bug in code I know well is a _lot_ easier.
For me writing a regex is easy only if I remember the syntax, which I never do because they differ between languages and I only need them once a month or so.
For me the fastest way is to ask generator to create a valid and not necessarily correct regex, so that I can tweak it. I successfully used gpt for just that recently. It even got the capture groups right.
I agree. I similar arguments ("just write examples") a lot, and I really don't get that. Finding a comprehensive set of examples for code, regexps, shell, whatever is very, very hard.
This feels like a really cool idea for a tool - I would 100% use something that generates matching strings to a regex expression for checking my own or understanding other people's regex.