Regex Isn't Hard (2023)
timkellogg.me
Regex Isn't Hard (2023)
1–10 of 109 posts
Re: Regex Isn't Hard (2023)
#2I mean sure, if it was my full-time job to write regexes I’d probably get pretty good at it. But instead a really complex one comes up maybe once a year for me and so I have to go to some online regex checker and start iteratively building one up, spending hours only find some condition where it doesn’t work and back to the checker...
So I don’t think it’s easy, but I do agree that they are very useful.
Re: Regex Isn't Hard (2023)
#3Found an error immediately "Any lowercase character" doesn't match all Swedish lowercase characters.
Re: Regex Isn't Hard (2023)
#4The text on that ai generated image at the top is definitely... interesting
Re: Regex Isn't Hard (2023)
#5This is truly one thing AI solved. Hard to write, easy to test. No one needs to learn this convoluted syntax in the future and we're all better for it.
Re: Regex Isn't Hard (2023)
#6Nothing is hard once you've learned to do it intuitively.
The hardest part is remembering how you struggled with it when you started.
Re: Regex Isn't Hard (2023)
#7The text on that ai generated image at the top is definitely... interesting
I am slow, why do you say this?
Re: Regex Isn't Hard (2023)
#8I strongly agree with [^"] etc. over . and .?
Involves much less thinking!
Re: Regex Isn't Hard (2023)
#9> e.g. This pattern ([0-9][0-9]?[0-9]][.])+ matches one, two or three digits followed by a . and also matches repeated patterns of this. This wold match an IP address (albeit not strictly).
I love regular expressions but one thing I've learned over the years is the syntax is dense enough that even people who are confident enough to start writing regex tutorials often can't write a regex that matches an IP address.
Re: Regex Isn't Hard (2023)
#10Confession: 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.