A GPT 3.5 powered tool for generating regex
fuckregex.dev
A GPT 3.5 powered tool for generating regex
1–10 of 24 posts
Re: A GPT 3.5 powered tool for generating regex
#2Re: A GPT 3.5 powered tool for generating regex
#3When I add a regex to something, I pretty much always also add a bunch of unit test cases for it, and I request the same if I see one in a PR. It's much easier to just see a bunch of test cases that help validate than it, and frankly, half the time when I write my own cases I think of situations that could be better handled.
Human- or GPT-generated doesn't really matter IMHO; it still needs tests.
Interestingly, chatGPT is pretty good at generating test cases for regex. It would be really cool to see that functionality integrated to this tool.
Re: A GPT 3.5 powered tool for generating regex
#4Re: A GPT 3.5 powered tool for generating regex
#5Re: A GPT 3.5 powered tool for generating regex
#6Pretty neat, and it definitely can generate some complex regex.. But I have to say I don't trust it! When I add a regex to something, I pretty much always also add a bunch of unit test cases for it, and I request the same if I see one in a PR. It's much easier to just see a bunch of test cases that help validate than it, and frankly, half the time when I write my own cases I think of situations that could be better h…
I think this is the biggest part. Automatically generated test cases for regex will make verifying regex way easier.
Even better, when you come across some ridiculous unknown legacy regex you can ask for an explanation of it and for test cases to verify that explanation.
Re: A GPT 3.5 powered tool for generating regex
#7ChatGPT is also very useful for just explaining what a regexp you already have actually does.
Re: A GPT 3.5 powered tool for generating regex
#8If you're using a regex it's a smell that there is a better tool for what you need to do. A ton of if statements is a much more readable way of writing code than regex.
Re: A GPT 3.5 powered tool for generating regex
#9What would you say was the query for this?