A GPT 3.5 powered tool for generating regex
11–20 of 24 posts
Re: A GPT 3.5 powered tool for generating regex
#12Earlier quoted context omitted.
There are some neat tools for visualizing a regex like https://regexper.com/
There's also regexr.com which explains in more or less plain English what's happening
Re: A GPT 3.5 powered tool for generating regex
#13Ironically, it showed us the real future of AI
Re: A GPT 3.5 powered tool for generating regex
#14I'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.
Re: A GPT 3.5 powered tool for generating regex
#15This 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.
A regex that worked for all names would be extremely weak. I can’t imagine it being much more than testing valid characters.
Re: A GPT 3.5 powered tool for generating regex
#16Re: A GPT 3.5 powered tool for generating regex
#17If 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.
* https://www.oreilly.com/library/view/regular-expressions-coo...
Re: A GPT 3.5 powered tool for generating regex
#18This 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.
It should be required reading before being allowed to write code that'll operate on user profiles, but there's no such thing as a programming license, so this link will have to do.
Re: A GPT 3.5 powered tool for generating regex
#19> /^(?:\/(?:\\\/|[^\/\n])+\/[gimuy]{0,5}|\\[^\n]|[^\n\\\/])+$/ What would you say was the query for this?
> [gimuy]{0,5}: This part of the pattern matches optional regex flags that can follow the closing forward slash of the regex pattern. The allowed flags are g (global), i (case-insensitive), m (multiline), u (unicode), and y (sticky). This part of the pattern matches zero to five of these flags, without repetition.
Full response: https://gist.github.com/nicolasff/3bbfb4cb8a514f58e140b887bf...