GPT has completely changed my use and feeling about regex. I used to hate them, would rather write the logic myself in a language I understand. But now I just ask GPT for the regex I need and voila!
That's interesting. I personally like regexes very much but I'm slow to create them so I figured I'd ask ChatGPT a few times and just double check its work and it got them all wrong.
I recently asked it to produce a regex for me, and it responded that as a large language model, it wasn’t allowed to produce hate speech… Not making this up.
Every regular expression I’ve seen produced by a large language model has either being broken, or done an unacceptably bad job due to being the wrong tool for the job (e.g. validating an email address with a fairly short regular expression, which I’ve seen people share the answers of at least three times).
Writing regexes is one of the most fun things that sometimes pop up at work. A little puzzle. Well-defined, clear that there must be a solution, somewhat easily checkable .. the easiest kind of task. I enjoy this just as much as some people enjoy crosswords or sudoku. Nobody would ask chatgpt to solve a sudoku for them (It would get them all wrong anyway.) No way I'm gonna let GPT take this away from me.