←back to thread

Regex Isn't Hard (2023)

(timkellogg.me)
75 points asicsp | 7 comments | | HN request time: 1.055s | source | bottom
1. TrackerFF ◴[] No.43750504[source]
Confession: Regex knowledge is one of those things I've let completely atrophy after integrating LLMs into my workflow. I guess if the day comes that AI/ML models suddenly disappear, or become completely unavailable to me, I'll have to get into the nitty gritty of Regex again...but until that time, it is a "solved problem" for my part.
replies(3): >>43750611 #>>43750637 #>>43750872 #
2. SnowingXIV ◴[] No.43750611[source]
Yeah, this is my heaviest use case too. Mostly because it generally does save me a bit of time and is easily verifiable with tools like rubular and then can tweak what is needed once 90% there.
3. throw-qqqqq ◴[] No.43750637[source]
IMO it’s a “language” you need to understand in order to use.

Just like you wouldn’t copy/paste any random snippet into your source code if you don’t understand exactly what it does.

I see a lot of broken regex at work from people who use regular expressions but don’t understand them (for various reasons).

It used to come with a “found this on stackoverflow”-excuse, but mostly now it’s “AI told me to use this” instead.

replies(1): >>43750695 #
4. qiine ◴[] No.43750695[source]
yeah programmers famously understands all the random boilerplate incantations they copy past in their code to get things going.

totally definitively

replies(2): >>43750763 #>>43752505 #
5. throw-qqqqq ◴[] No.43750763{3}[source]
We all have our own ideas of Utopia I guess :)
6. TheOtherHobbes ◴[] No.43750872[source]
It's hilarious that the most reliable way to write a complex regex is to fire up billions of dollars of state of the art ML code and ask for what you want in English.
7. tomsmeding ◴[] No.43752505{3}[source]
I know some people consider this fine. I do not. The fact that the world is not ideal does not mean that we cannot continue to improve things.