Live data from Hacker News

A GPT 3.5 powered tool for generating regex

fuckregex.dev

21–24 of 24 posts

Re: A GPT 3.5 powered tool for generating regex

#21
I think I broke it pretty badly asking for "A ll(1) grammar validator" as it answered `^(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:[A-Z]|[a-z])(?:[A-Z]|[a-z]|[0-9])):(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:(?:[A-Z]|[a-z])(?:[A-Z]|[a-z]|[0-9])):)+(?:(?:(?

lol

id: chatcmpl-6zxdwNH3hW7DuZqnCkx4Ukx9rXiuA token usage: 367 date: 1680225296

Re: A GPT 3.5 powered tool for generating regex

#22

This is what is gives to select names: /^[A-Z][a-z]+(?: [A-Z][a-z]+)*$/ I'm pretty sure quite a lot of people's names wouldn't be accepted by that. It helps if you add "even weird and foreign names", but who knows if that's actually enough to capture everything.

There is basically no regex to validate names except for maybe "is not an empty string".

Re: A GPT 3.5 powered tool for generating regex

#23
post #13

Rate limit reached for default-gpt-3.5-turbo in organization org-cy3MEIpOsyQxMokN4SQON5gb on requests per min. Limit: 20 / min. Please try again in 3s. Contact support@openai.com if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit https://platform.openai.com/account/billing to add a payment method. Ironically, it showed us the real future of AI

I used to work for a tech company which ran our incident management stack on Google Cloud. One day, our incident management tool was unavailable due to some billing issue.

Turns out, someone during the test phase set up a limit of $1/day usage, and nobody ever changed it. We'd just finally hit that limit.

What I'm saying is, this isn't an AI-only problem, but it's comforting to know it's already impacting AI-backed tools.

Re: A GPT 3.5 powered tool for generating regex

#24
post #5

If 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.

Unfortunately regex is the best we have. A bunch of if statements is also a whole less efficient and prone to errors than a regex statement. Once you start to learn regex, it actually isn't that bad. The challenging part is that a lot of people cut and paste not really understanding it and you end up with a bunch of bad regex examples.

Eh, I think the challenging part is understanding a complex regex that's already been written. You really do need good comments and unit tests to go along with a regex in order to understand the intent, otherwise they rapidly become unmaintainable.
Post reply on HN